r73199 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73198‎ | r73199 | r73200 >
Date:08:46, 17 September 2010
Author:daniel
Status:deferred
Tags:
Comment:
improved console output
Modified paths:
  • /trunk/extensions/DataTransclusion/ImportMAB2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransclusion/ImportMAB2.php
@@ -90,19 +90,22 @@
9191
9292 $src = $this->mArgs[0];
9393 $dir = $this->mArgs[1];
94 - $this->blob_table = $this->mArgs[2];
95 - $this->index_table = $this->mArgs[3];
9694
9795 if ( !isset( $wgDataTransclusionSources[ $src ] ) ) {
9896 throw new MWException( "unknown transclusion data source '$src', not found in \$wgDataTransclusionSources" );
9997 }
10098
 99+ $this->output( "using settings for data transclusion source \"$src\".\n" );
 100+
101101 $this->source = DataTransclusionHandler::getDataSource( $src );
102102
103103 if ( !( $this->source instanceof DBDataTransclusionSource ) ) {
104104 throw new MWException( "bad data source '$src': not compatible with DBDataTransclusionSource" );
105105 }
106106
 107+ $this->blob_table = $this->mArgs[2];
 108+ $this->index_table = $this->mArgs[3];
 109+
107110 if ( $this->hasOption( 'prefix' ) ) {
108111 $prefix = $this->getOption( "prefix" );
109112 $this->blob_table = $prefix . $this->blob_table;
@@ -113,10 +116,16 @@
114117 $this->index_table = $db->tableName( $this->index_table );
115118 }
116119
117 - if ( $this->hasOption('create') && !$this->debug ) {
118 - $this->createTables( $this->blob_table, $this->index_table );
119 - } else if ( $this->hasOption('truncate') && !$this->debug ) {
120 - $this->truncateTables( $this->blob_table, $this->index_table );
 120+ if ( !$this->debug ) {
 121+ $this->output( "using tables {$this->blob_table} and {$this->index_table}.\n" );
 122+
 123+ if ( $this->hasOption('create') ) {
 124+ $this->output( "creating tables if neccessary.\n" );
 125+ $this->createTables( $this->blob_table, $this->index_table );
 126+ } else if ( $this->hasOption('truncate') ) {
 127+ $this->output( "truncating tables.\n" );
 128+ $this->truncateTables( $this->blob_table, $this->index_table );
 129+ }
121130 }
122131
123132 $this->id_map = array();
@@ -354,7 +363,7 @@
355364 }
356365
357366 if ( !$found ) {
358 - $this->output( "ignoring record #$id from file $file\n" );
 367+ $this->output( "ignoring record #$id\n" );
359368 continue;
360369 }
361370 }

Status & tagging log