r74072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74071‎ | r74072 | r74073 >
Date:15:11, 1 October 2010
Author:demon
Status:ok
Tags:
Comment:
wfOut() -> $this->output(). More useful in the long run. No functional changes.
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/SqliteUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -87,6 +87,16 @@
8888 }
8989
9090 /**
 91+ * Output some text. Right now this is a wrapper for wfOut, but hopefully
 92+ * that function can go away some day :)
 93+ *
 94+ * @param $str String: Text to output
 95+ */
 96+ protected function output( $str ) {
 97+ wfOut( $str );
 98+ }
 99+
 100+ /**
91101 * Add a new update coming from an extension. This should be called by
92102 * extensions while executing the LoadExtensionSchemaUpdates hook.
93103 *
@@ -272,11 +282,11 @@
273283 */
274284 protected function addTable( $name, $patch, $fullpath = false ) {
275285 if ( $this->db->tableExists( $name ) ) {
276 - wfOut( "...$name table already exists.\n" );
 286+ $this->output( "...$name table already exists.\n" );
277287 } else {
278 - wfOut( "Creating $name table..." );
 288+ $this->output( "Creating $name table..." );
279289 $this->applyPatch( $patch, $fullpath );
280 - wfOut( "ok\n" );
 290+ $this->output( "ok\n" );
281291 }
282292 }
283293
@@ -289,13 +299,13 @@
290300 */
291301 protected function addField( $table, $field, $patch, $fullpath = false ) {
292302 if ( !$this->db->tableExists( $table ) ) {
293 - wfOut( "...$table table does not exist, skipping new field patch\n" );
 303+ $this->output( "...$table table does not exist, skipping new field patch\n" );
294304 } elseif ( $this->db->fieldExists( $table, $field ) ) {
295 - wfOut( "...have $field field in $table table.\n" );
 305+ $this->output( "...have $field field in $table table.\n" );
296306 } else {
297 - wfOut( "Adding $field field to table $table..." );
 307+ $this->output( "Adding $field field to table $table..." );
298308 $this->applyPatch( $patch, $fullpath );
299 - wfOut( "ok\n" );
 309+ $this->output( "ok\n" );
300310 }
301311 }
302312
@@ -308,11 +318,11 @@
309319 */
310320 function addIndex( $table, $index, $patch, $fullpath = false ) {
311321 if ( $this->db->indexExists( $table, $index ) ) {
312 - wfOut( "...$index key already set on $table table.\n" );
 322+ $this->output( "...$index key already set on $table table.\n" );
313323 } else {
314 - wfOut( "Adding $index key to table $table... " );
 324+ $this->output( "Adding $index key to table $table... " );
315325 $this->applyPatch( $patch, $fullpath );
316 - wfOut( "ok\n" );
 326+ $this->output( "ok\n" );
317327 }
318328 }
319329
@@ -326,11 +336,11 @@
327337 */
328338 function dropField( $table, $field, $patch, $fullpath = false ) {
329339 if ( $this->db->fieldExists( $table, $field ) ) {
330 - wfOut( "Table $table contains $field field. Dropping... " );
 340+ $this->output( "Table $table contains $field field. Dropping... " );
331341 $this->applyPatch( $patch, $fullpath );
332 - wfOut( "ok\n" );
 342+ $this->output( "ok\n" );
333343 } else {
334 - wfOut( "...$table table does not contain $field field.\n" );
 344+ $this->output( "...$table table does not contain $field field.\n" );
335345 }
336346 }
337347
@@ -344,11 +354,11 @@
345355 */
346356 function dropIndex( $table, $index, $patch, $fullpath = false ) {
347357 if ( $this->db->indexExists( $table, $index ) ) {
348 - wfOut( "Dropping $index from table $table... " );
 358+ $this->output( "Dropping $index from table $table... " );
349359 $this->applyPatch( $patch, $fullpath );
350 - wfOut( "ok\n" );
 360+ $this->output( "ok\n" );
351361 } else {
352 - wfOut( "...$index key doesn't exist.\n" );
 362+ $this->output( "...$index key doesn't exist.\n" );
353363 }
354364 }
355365
@@ -362,13 +372,13 @@
363373 */
364374 public function modifyField( $table, $field, $patch, $fullpath = false ) {
365375 if ( !$this->db->tableExists( $table ) ) {
366 - wfOut( "...$table table does not exist, skipping modify field patch\n" );
 376+ $this->output( "...$table table does not exist, skipping modify field patch\n" );
367377 } elseif ( !$this->db->fieldExists( $table, $field ) ) {
368 - wfOut( "...$field field does not exist in $table table, skipping modify field patch\n" );
 378+ $this->output( "...$field field does not exist in $table table, skipping modify field patch\n" );
369379 } else {
370 - wfOut( "Modifying $field field of table $table..." );
 380+ $this->output( "Modifying $field field of table $table..." );
371381 $this->applyPatch( $patch, $fullpath );
372 - wfOut( "ok\n" );
 382+ $this->output( "ok\n" );
373383 }
374384 }
375385
@@ -378,23 +388,23 @@
379389 protected function purgeCache() {
380390 # We can't guarantee that the user will be able to use TRUNCATE,
381391 # but we know that DELETE is available to us
382 - wfOut( "Purging caches..." );
 392+ $this->output( "Purging caches..." );
383393 $this->db->delete( 'objectcache', '*', __METHOD__ );
384 - wfOut( "done.\n" );
 394+ $this->output( "done.\n" );
385395 }
386396
387397 /**
388398 * Check the site_stats table is not properly populated.
389399 */
390400 protected function checkStats() {
391 - wfOut( "Checking site_stats row..." );
 401+ $this->output( "Checking site_stats row..." );
392402 $row = $this->db->selectRow( 'site_stats', '*', array( 'ss_row_id' => 1 ), __METHOD__ );
393403 if ( $row === false ) {
394 - wfOut( "data is missing! rebuilding...\n" );
 404+ $this->output( "data is missing! rebuilding...\n" );
395405 } elseif ( isset( $row->site_stats ) && $row->ss_total_pages == -1 ) {
396 - wfOut( "missing ss_total_pages, rebuilding...\n" );
 406+ $this->output( "missing ss_total_pages, rebuilding...\n" );
397407 } else {
398 - wfOut( "done.\n" );
 408+ $this->output( "done.\n" );
399409 return;
400410 }
401411 SiteStatsInit::doAllAndCommit( false );
@@ -414,33 +424,33 @@
415425 array( 'ss_row_id' => 1 ), __METHOD__, array( 'LIMIT' => 1 )
416426 );
417427 }
418 - wfOut( "...ss_active_users user count set...\n" );
 428+ $this->output( "...ss_active_users user count set...\n" );
419429 }
420430
421431 protected function doLogSearchPopulation() {
422432 if ( $this->updateRowExists( 'populate log_search' ) ) {
423 - wfOut( "...log_search table already populated.\n" );
 433+ $this->output( "...log_search table already populated.\n" );
424434 return;
425435 }
426436
427 - wfOut(
 437+ $this->output(
428438 "Populating log_search table, printing progress markers. For large\n" .
429439 "databases, you may want to hit Ctrl-C and do this manually with\n" .
430440 "maintenance/populateLogSearch.php.\n" );
431441 $task = new PopulateLogSearch();
432442 $task->execute();
433 - wfOut( "Done populating log_search table.\n" );
 443+ $this->output( "Done populating log_search table.\n" );
434444 }
435445
436446 function doUpdateTranscacheField() {
437447 if ( $this->updateRowExists( 'convert transcache field' ) ) {
438 - wfOut( "...transcache tc_time already converted.\n" );
 448+ $this->output( "...transcache tc_time already converted.\n" );
439449 return;
440450 }
441451
442 - wfOut( "Converting tc_time from UNIX epoch to MediaWiki timestamp... " );
 452+ $this->output( "Converting tc_time from UNIX epoch to MediaWiki timestamp... " );
443453 $this->applyPatch( 'patch-tc-timestamp.sql' );
444 - wfOut( "ok\n" );
 454+ $this->output( "ok\n" );
445455 }
446456
447457 protected function doCollationUpdate() {
@@ -451,7 +461,7 @@
452462 'cl_collation != ' . $this->db->addQuotes( $wgCategoryCollation ),
453463 __METHOD__
454464 ) == 0 ) {
455 - wfOut( "...collations up-to-date.\n" );
 465+ $this->output( "...collations up-to-date.\n" );
456466 return;
457467 }
458468
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -188,11 +188,11 @@
189189 $flags = explode( ' ', mysql_field_flags( $res->result, 0 ) );
190190
191191 if ( in_array( 'binary', $flags ) ) {
192 - wfOut( "...$table table has correct $field encoding.\n" );
 192+ $this->output( "...$table table has correct $field encoding.\n" );
193193 } else {
194 - wfOut( "Fixing $field encoding on $table table... " );
 194+ $this->output( "Fixing $field encoding on $table table... " );
195195 $this->db->applyPatch( $patchFile );
196 - wfOut( "ok\n" );
 196+ $this->output( "ok\n" );
197197 }
198198 }
199199
@@ -209,12 +209,12 @@
210210 if ( $info ) {
211211 foreach ( $info as $row ) {
212212 if ( $row->Column_name == $field ) {
213 - wfOut( "...index $index on table $table includes field $field\n" );
 213+ $this->output( "...index $index on table $table includes field $field\n" );
214214 return true;
215215 }
216216 }
217217 }
218 - wfOut( "...index $index on table $table has no field $field; adding\n" );
 218+ $this->output( "...index $index on table $table has no field $field; adding\n" );
219219 return false;
220220 }
221221
@@ -225,16 +225,16 @@
226226 global $IP;
227227
228228 if ( $this->db->tableExists( "interwiki" ) ) {
229 - wfOut( "...already have interwiki table\n" );
 229+ $this->output( "...already have interwiki table\n" );
230230 return;
231231 }
232232
233 - wfOut( 'Creating interwiki table...' );
 233+ $this->output( 'Creating interwiki table...' );
234234 $this->applyPatch( 'patch-interwiki.sql' );
235 - wfOut( "ok\n" );
236 - wfOut( 'Adding default interwiki definitions...' );
 235+ $this->output( "ok\n" );
 236+ $this->output( 'Adding default interwiki definitions...' );
237237 $this->applyPatch( "$IP/maintenance/interwiki.sql", true );
238 - wfOut( "ok\n" );
 238+ $this->output( "ok\n" );
239239 }
240240
241241 /**
@@ -243,13 +243,13 @@
244244 protected function doIndexUpdate() {
245245 $meta = $this->db->fieldInfo( 'recentchanges', 'rc_timestamp' );
246246 if ( $meta->isMultipleKey() ) {
247 - wfOut( "...indexes seem up to 20031107 standards\n" );
 247+ $this->output( "...indexes seem up to 20031107 standards\n" );
248248 return;
249249 }
250250
251 - wfOut( "Updating indexes to 20031107..." );
 251+ $this->output( "Updating indexes to 20031107..." );
252252 $this->applyPatch( 'patch-indexes.sql', true );
253 - wfOut( "ok\n" );
 253+ $this->output( "ok\n" );
254254 }
255255
256256 protected function doOldLinksUpdate() {
@@ -260,14 +260,14 @@
261261 protected function doFixAncientImagelinks() {
262262 $info = $this->db->fieldInfo( 'imagelinks', 'il_from' );
263263 if ( !$info || $info->type() !== 'string' ) {
264 - wfOut( "...il_from OK\n" );
 264+ $this->output( "...il_from OK\n" );
265265 return;
266266 }
267267
268 - wfOut( "Fixing ancient broken imagelinks table.\n" );
269 - wfOut( "NOTE: you will have to run maintenance/refreshLinks.php after this.\n" );
 268+ $this->output( "Fixing ancient broken imagelinks table.\n" );
 269+ $this->output( "NOTE: you will have to run maintenance/refreshLinks.php after this.\n" );
270270 $this->applyPatch( 'patch-fix-il_from.sql' );
271 - wfOut( "ok\n" );
 271+ $this->output( "ok\n" );
272272 }
273273
274274 /**
@@ -277,11 +277,11 @@
278278 $talk = $this->db->selectField( 'watchlist', 'count(*)', 'wl_namespace & 1', __METHOD__ );
279279 $nontalk = $this->db->selectField( 'watchlist', 'count(*)', 'NOT (wl_namespace & 1)', __METHOD__ );
280280 if ( $talk == $nontalk ) {
281 - wfOut( "...watchlist talk page rows already present\n" );
 281+ $this->output( "...watchlist talk page rows already present\n" );
282282 return;
283283 }
284284
285 - wfOut( "Adding missing watchlist talk page rows... " );
 285+ $this->output( "Adding missing watchlist talk page rows... " );
286286 $this->db->insertSelect( 'watchlist', 'watchlist',
287287 array(
288288 'wl_user' => 'wl_user',
@@ -289,18 +289,18 @@
290290 'wl_title' => 'wl_title',
291291 'wl_notificationtimestamp' => 'wl_notificationtimestamp'
292292 ), array( 'NOT (wl_namespace & 1)' ), __METHOD__, 'IGNORE' );
293 - wfOut( "ok\n" );
 293+ $this->output( "ok\n" );
294294 }
295295
296296 function doSchemaRestructuring() {
297297 if ( $this->db->tableExists( 'page' ) ) {
298 - wfOut( "...page table already exists.\n" );
 298+ $this->output( "...page table already exists.\n" );
299299 return;
300300 }
301301
302 - wfOut( "...converting from cur/old to page/revision/text DB structure.\n" );
303 - wfOut( wfTimestamp( TS_DB ) );
304 - wfOut( "......checking for duplicate entries.\n" );
 302+ $this->output( "...converting from cur/old to page/revision/text DB structure.\n" );
 303+ $this->output( wfTimestamp( TS_DB ) );
 304+ $this->output( "......checking for duplicate entries.\n" );
305305
306306 list ( $cur, $old, $page, $revision, $text ) = $this->db->tableNamesN( 'cur', 'old', 'page', 'revision', 'text' );
307307
@@ -308,15 +308,15 @@
309309 FROM $cur GROUP BY cur_title, cur_namespace HAVING c>1", __METHOD__ );
310310
311311 if ( $rows->numRows() > 0 ) {
312 - wfOut( wfTimestamp( TS_DB ) );
313 - wfOut( "......<b>Found duplicate entries</b>\n" );
314 - wfOut( sprintf( "<b> %-60s %3s %5s</b>\n", 'Title', 'NS', 'Count' ) );
 312+ $this->output( wfTimestamp( TS_DB ) );
 313+ $this->output( "......<b>Found duplicate entries</b>\n" );
 314+ $this->output( sprintf( "<b> %-60s %3s %5s</b>\n", 'Title', 'NS', 'Count' ) );
315315 foreach ( $rows as $row ) {
316316 if ( ! isset( $duplicate[$row->cur_namespace] ) ) {
317317 $duplicate[$row->cur_namespace] = array();
318318 }
319319 $duplicate[$row->cur_namespace][] = $row->cur_title;
320 - wfOut( sprintf( " %-60s %3s %5s\n", $row->cur_title, $row->cur_namespace, $row->c ) );
 320+ $this->output( sprintf( " %-60s %3s %5s\n", $row->cur_title, $row->cur_namespace, $row->c ) );
321321 }
322322 $sql = "SELECT cur_title, cur_namespace, cur_id, cur_timestamp FROM $cur WHERE ";
323323 $firstCond = true;
@@ -356,13 +356,13 @@
357357 }
358358 $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')';
359359 $rows = $this->db->query( $sql, __METHOD__ );
360 - wfOut( wfTimestamp( TS_DB ) );
361 - wfOut( "......<b>Deleted</b> " . $this->db->affectedRows() . " records.\n" );
 360+ $this->output( wfTimestamp( TS_DB ) );
 361+ $this->output( "......<b>Deleted</b> " . $this->db->affectedRows() . " records.\n" );
362362 }
363363
364364
365 - wfOut( wfTimestamp( TS_DB ) );
366 - wfOut( "......Creating tables.\n" );
 365+ $this->output( wfTimestamp( TS_DB ) );
 366+ $this->output( "......Creating tables.\n" );
367367 $this->db->query( "CREATE TABLE $page (
368368 page_id int(8) unsigned NOT NULL auto_increment,
369369 page_namespace int NOT NULL,
@@ -400,26 +400,26 @@
401401 INDEX usertext_timestamp (rev_user_text,rev_timestamp)
402402 ) ENGINE=InnoDB", __METHOD__ );
403403
404 - wfOut( wfTimestamp( TS_DB ) );
405 - wfOut( "......Locking tables.\n" );
 404+ $this->output( wfTimestamp( TS_DB ) );
 405+ $this->output( "......Locking tables.\n" );
406406 $this->db->query( "LOCK TABLES $page WRITE, $revision WRITE, $old WRITE, $cur WRITE", __METHOD__ );
407407
408408 $maxold = intval( $this->db->selectField( 'old', 'max(old_id)', '', __METHOD__ ) );
409 - wfOut( wfTimestamp( TS_DB ) );
410 - wfOut( "......maxold is {$maxold}\n" );
 409+ $this->output( wfTimestamp( TS_DB ) );
 410+ $this->output( "......maxold is {$maxold}\n" );
411411
412 - wfOut( wfTimestamp( TS_DB ) );
 412+ $this->output( wfTimestamp( TS_DB ) );
413413 global $wgLegacySchemaConversion;
414414 if ( $wgLegacySchemaConversion ) {
415415 // Create HistoryBlobCurStub entries.
416416 // Text will be pulled from the leftover 'cur' table at runtime.
417 - wfOut( "......Moving metadata from cur; using blob references to text in cur table.\n" );
 417+ $this->output( "......Moving metadata from cur; using blob references to text in cur table.\n" );
418418 $cur_text = "concat('O:18:\"historyblobcurstub\":1:{s:6:\"mCurId\";i:',cur_id,';}')";
419419 $cur_flags = "'object'";
420420 } else {
421421 // Copy all cur text in immediately: this may take longer but avoids
422422 // having to keep an extra table around.
423 - wfOut( "......Moving text from cur.\n" );
 423+ $this->output( "......Moving text from cur.\n" );
424424 $cur_text = 'cur_text';
425425 $cur_flags = "''";
426426 }
@@ -428,16 +428,16 @@
429429 SELECT cur_namespace, cur_title, $cur_text, cur_comment, cur_user, cur_user_text, cur_timestamp, cur_minor_edit, $cur_flags
430430 FROM $cur", __METHOD__ );
431431
432 - wfOut( wfTimestamp( TS_DB ) );
433 - wfOut( "......Setting up revision table.\n" );
 432+ $this->output( wfTimestamp( TS_DB ) );
 433+ $this->output( "......Setting up revision table.\n" );
434434 $this->db->query( "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text, rev_timestamp,
435435 rev_minor_edit)
436436 SELECT old_id, cur_id, old_comment, old_user, old_user_text,
437437 old_timestamp, old_minor_edit
438438 FROM $old,$cur WHERE old_namespace=cur_namespace AND old_title=cur_title", __METHOD__ );
439439
440 - wfOut( wfTimestamp( TS_DB ) );
441 - wfOut( "......Setting up page table.\n" );
 440+ $this->output( wfTimestamp( TS_DB ) );
 441+ $this->output( "......Setting up page table.\n" );
442442 $this->db->query( "INSERT INTO $page (page_id, page_namespace, page_title, page_restrictions, page_counter,
443443 page_is_redirect, page_is_new, page_random, page_touched, page_latest, page_len)
444444 SELECT cur_id, cur_namespace, cur_title, cur_restrictions, cur_counter, cur_is_redirect, cur_is_new,
@@ -445,16 +445,16 @@
446446 FROM $cur,$revision
447447 WHERE cur_id=rev_page AND rev_timestamp=cur_timestamp AND rev_id > {$maxold}", __METHOD__ );
448448
449 - wfOut( wfTimestamp( TS_DB ) );
450 - wfOut( "......Unlocking tables.\n" );
 449+ $this->output( wfTimestamp( TS_DB ) );
 450+ $this->output( "......Unlocking tables.\n" );
451451 $this->db->query( "UNLOCK TABLES", __METHOD__ );
452452
453 - wfOut( wfTimestamp( TS_DB ) );
454 - wfOut( "......Renaming old.\n" );
 453+ $this->output( wfTimestamp( TS_DB ) );
 454+ $this->output( "......Renaming old.\n" );
455455 $this->db->query( "ALTER TABLE $old RENAME TO $text", __METHOD__ );
456456
457 - wfOut( wfTimestamp( TS_DB ) );
458 - wfOut( "...done.\n" );
 457+ $this->output( wfTimestamp( TS_DB ) );
 458+ $this->output( "...done.\n" );
459459 }
460460
461461 protected function doNamespaceSize() {
@@ -474,24 +474,24 @@
475475 $info = $this->db->fetchObject( $result );
476476
477477 if ( substr( $info->Type, 0, 3 ) == 'int' ) {
478 - wfOut( "...$field is already a full int ($info->Type).\n" );
 478+ $this->output( "...$field is already a full int ($info->Type).\n" );
479479 } else {
480 - wfOut( "Promoting $field from $info->Type to int... " );
 480+ $this->output( "Promoting $field from $info->Type to int... " );
481481 $this->db->query( "ALTER TABLE $tablename MODIFY $field int NOT NULL", __METHOD__ );
482 - wfOut( "ok\n" );
 482+ $this->output( "ok\n" );
483483 }
484484 }
485485 }
486486
487487 protected function doPagelinksUpdate() {
488488 if ( $this->db->tableExists( 'pagelinks' ) ) {
489 - wfOut( "...already have pagelinks table.\n" );
 489+ $this->output( "...already have pagelinks table.\n" );
490490 return;
491491 }
492492
493 - wfOut( "Converting links and brokenlinks tables to pagelinks... " );
 493+ $this->output( "Converting links and brokenlinks tables to pagelinks... " );
494494 $this->applyPatch( 'patch-pagelinks.sql' );
495 - wfOut( "ok\n" );
 495+ $this->output( "ok\n" );
496496
497497 global $wgContLang;
498498 foreach ( MWNamespace::getCanonicalNamespaces() as $ns => $name ) {
@@ -499,7 +499,7 @@
500500 continue;
501501 }
502502
503 - wfOut( "Cleaning up broken links for namespace $ns... " );
 503+ $this->output( "Cleaning up broken links for namespace $ns... " );
504504
505505 $pagelinks = $this->db->tableName( 'pagelinks' );
506506 $name = $wgContLang->getNsText( $ns );
@@ -513,23 +513,23 @@
514514 AND pl_title LIKE '$likeprefix:%'";
515515
516516 $this->db->query( $sql, __METHOD__ );
517 - wfOut( "ok\n" );
 517+ $this->output( "ok\n" );
518518 }
519519 }
520520
521521 protected function doUserUniqueUpdate() {
522522 $duper = new UserDupes( $this->db );
523523 if ( $duper->hasUniqueIndex() ) {
524 - wfOut( "...already have unique user_name index.\n" );
 524+ $this->output( "...already have unique user_name index.\n" );
525525 return;
526526 }
527527
528528 if ( !$duper->clearDupes() ) {
529 - wfOut( "WARNING: This next step will probably fail due to unfixed duplicates...\n" );
 529+ $this->output( "WARNING: This next step will probably fail due to unfixed duplicates...\n" );
530530 }
531 - wfOut( "Adding unique index on user_name... " );
 531+ $this->output( "Adding unique index on user_name... " );
532532 $this->applyPatch( 'patch-user_nameindex.sql' );
533 - wfOut( "ok\n" );
 533+ $this->output( "ok\n" );
534534 }
535535
536536 protected function doUserGroupsUpdate() {
@@ -538,42 +538,42 @@
539539 if ( $info->type() == 'int' ) {
540540 $oldug = $this->db->tableName( 'user_groups' );
541541 $newug = $this->db->tableName( 'user_groups_bogus' );
542 - wfOut( "user_groups table exists but is in bogus intermediate format. Renaming to $newug... " );
 542+ $this->output( "user_groups table exists but is in bogus intermediate format. Renaming to $newug... " );
543543 $this->db->query( "ALTER TABLE $oldug RENAME TO $newug", __METHOD__ );
544 - wfOut( "ok\n" );
 544+ $this->output( "ok\n" );
545545
546 - wfOut( "Re-adding fresh user_groups table... " );
 546+ $this->output( "Re-adding fresh user_groups table... " );
547547 $this->applyPatch( 'patch-user_groups.sql' );
548 - wfOut( "ok\n" );
 548+ $this->output( "ok\n" );
549549
550 - wfOut( "***\n" );
551 - wfOut( "*** WARNING: You will need to manually fix up user permissions in the user_groups\n" );
552 - wfOut( "*** table. Old 1.5 alpha versions did some pretty funky stuff...\n" );
553 - wfOut( "***\n" );
 550+ $this->output( "***\n" );
 551+ $this->output( "*** WARNING: You will need to manually fix up user permissions in the user_groups\n" );
 552+ $this->output( "*** table. Old 1.5 alpha versions did some pretty funky stuff...\n" );
 553+ $this->output( "***\n" );
554554 } else {
555 - wfOut( "...user_groups table exists and is in current format.\n" );
 555+ $this->output( "...user_groups table exists and is in current format.\n" );
556556 }
557557 return;
558558 }
559559
560 - wfOut( "Adding user_groups table... " );
 560+ $this->output( "Adding user_groups table... " );
561561 $this->applyPatch( 'patch-user_groups.sql' );
562 - wfOut( "ok\n" );
 562+ $this->output( "ok\n" );
563563
564564 if ( !$this->db->tableExists( 'user_rights' ) ) {
565565 if ( $this->db->fieldExists( 'user', 'user_rights' ) ) {
566 - wfOut( "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion..." );
 566+ $this->output( "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion..." );
567567 $this->db->applyPatch( 'patch-user_rights.sql' );
568 - wfOut( "ok\n" );
 568+ $this->output( "ok\n" );
569569 } else {
570 - wfOut( "*** WARNING: couldn't locate user_rights table or field for upgrade.\n" );
571 - wfOut( "*** You may need to manually configure some sysops by manipulating\n" );
572 - wfOut( "*** the user_groups table.\n" );
 570+ $this->output( "*** WARNING: couldn't locate user_rights table or field for upgrade.\n" );
 571+ $this->output( "*** You may need to manually configure some sysops by manipulating\n" );
 572+ $this->output( "*** the user_groups table.\n" );
573573 return;
574574 }
575575 }
576576
577 - wfOut( "Converting user_rights table to user_groups... " );
 577+ $this->output( "Converting user_rights table to user_groups... " );
578578 $result = $this->db->select( 'user_rights',
579579 array( 'ur_user', 'ur_rights' ),
580580 array( "ur_rights != ''" ),
@@ -592,7 +592,7 @@
593593 __METHOD__ );
594594 }
595595 }
596 - wfOut( "ok\n" );
 596+ $this->output( "ok\n" );
597597 }
598598
599599 /**
@@ -602,13 +602,13 @@
603603 protected function doWatchlistNull() {
604604 $info = $this->db->fieldInfo( 'watchlist', 'wl_notificationtimestamp' );
605605 if ( $info->nullable() ) {
606 - wfOut( "...wl_notificationtimestamp is already nullable.\n" );
 606+ $this->output( "...wl_notificationtimestamp is already nullable.\n" );
607607 return;
608608 }
609609
610 - wfOut( "Making wl_notificationtimestamp nullable... " );
 610+ $this->output( "Making wl_notificationtimestamp nullable... " );
611611 $this->applyPatch( 'patch-watchlist-null.sql' );
612 - wfOut( "ok\n" );
 612+ $this->output( "ok\n" );
613613 }
614614
615615 /**
@@ -617,24 +617,24 @@
618618 * @see bug 3946
619619 */
620620 protected function doPageRandomUpdate() {
621 - wfOut( "Setting page_random to a random value on rows where it equals 0..." );
 621+ $this->output( "Setting page_random to a random value on rows where it equals 0..." );
622622
623623 $page = $this->db->tableName( 'page' );
624624 $this->db->query( "UPDATE $page SET page_random = RAND() WHERE page_random = 0", __METHOD__ );
625625 $rows = $this->db->affectedRows();
626626
627 - wfOut( "changed $rows rows\n" );
 627+ $this->output( "changed $rows rows\n" );
628628 }
629629
630630 protected function doTemplatelinksUpdate() {
631631 if ( $this->db->tableExists( 'templatelinks' ) ) {
632 - wfOut( "...templatelinks table already exists\n" );
 632+ $this->output( "...templatelinks table already exists\n" );
633633 return;
634634 }
635635
636 - wfOut( "Creating templatelinks table...\n" );
 636+ $this->output( "Creating templatelinks table...\n" );
637637 $this->applyPatch( 'patch-templatelinks.sql' );
638 - wfOut( "Populating...\n" );
 638+ $this->output( "Populating...\n" );
639639 if ( wfGetLB()->getServerCount() > 1 ) {
640640 // Slow, replication-friendly update
641641 $res = $this->db->select( 'pagelinks', array( 'pl_from', 'pl_namespace', 'pl_title' ),
@@ -666,7 +666,7 @@
667667 ), __METHOD__
668668 );
669669 }
670 - wfOut( "Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update.\n" );
 670+ $this->output( "Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update.\n" );
671671 }
672672
673673 protected function doBacklinkingIndicesUpdate() {
@@ -675,7 +675,7 @@
676676 !$this->indexHasField( 'imagelinks', 'il_to', 'il_from' ) )
677677 {
678678 $this->applyPatch( 'patch-backlinkindexes.sql' );
679 - wfOut( "...backlinking indices updated\n" );
 679+ $this->output( "...backlinking indices updated\n" );
680680 }
681681 }
682682
@@ -686,16 +686,16 @@
687687 */
688688 protected function doRestrictionsUpdate() {
689689 if ( $this->db->tableExists( 'page_restrictions' ) ) {
690 - wfOut( "...page_restrictions table already exists.\n" );
 690+ $this->output( "...page_restrictions table already exists.\n" );
691691 return;
692692 }
693693
694 - wfOut( "Creating page_restrictions table..." );
 694+ $this->output( "Creating page_restrictions table..." );
695695 $this->applyPatch( 'patch-page_restrictions.sql' );
696696 $this->applyPatch( 'patch-page_restrictions_sortkey.sql' );
697 - wfOut( "ok\n" );
 697+ $this->output( "ok\n" );
698698
699 - wfOut( "Migrating old restrictions to new table...\n" );
 699+ $this->output( "Migrating old restrictions to new table...\n" );
700700 $task = new UpdateRestrictions();
701701 $task->execute();
702702 }
@@ -703,17 +703,17 @@
704704 protected function doCategorylinksIndicesUpdate() {
705705 if ( !$this->indexHasField( 'categorylinks', 'cl_sortkey', 'cl_from' ) ) {
706706 $this->applyPatch( 'patch-categorylinksindex.sql' );
707 - wfOut( "...categorylinks indices updated\n" );
 707+ $this->output( "...categorylinks indices updated\n" );
708708 }
709709 }
710710
711711 protected function doCategoryPopulation() {
712712 if ( $this->updateRowExists( 'populate category' ) ) {
713 - wfOut( "...category table already populated.\n" );
 713+ $this->output( "...category table already populated.\n" );
714714 return;
715715 }
716716
717 - wfOut(
 717+ $this->output(
718718 "Populating category table, printing progress markers. " .
719719 "For large databases, you\n" .
720720 "may want to hit Ctrl-C and do this manually with maintenance/\n" .
@@ -721,12 +721,12 @@
722722 );
723723 $task = new PopulateCategory();
724724 $task->execute();
725 - wfOut( "Done populating category table.\n" );
 725+ $this->output( "Done populating category table.\n" );
726726 }
727727
728728 protected function doPopulateParentId() {
729729 if ( $this->updateRowExists( 'populate rev_parent_id' ) ) {
730 - wfOut( "...rev_parent_id column already populated.\n" );
 730+ $this->output( "...rev_parent_id column already populated.\n" );
731731 return;
732732 }
733733
@@ -738,11 +738,11 @@
739739 if ( !$this->db->tableExists( 'profiling' ) ) {
740740 // Simply ignore
741741 } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory' ) ) {
742 - wfOut( "...profiling table has pf_memory field.\n" );
 742+ $this->output( "...profiling table has pf_memory field.\n" );
743743 } else {
744 - wfOut( "Adding pf_memory field to table profiling..." );
 744+ $this->output( "Adding pf_memory field to table profiling..." );
745745 $this->applyPatch( 'patch-profiling-memory.sql' );
746 - wfOut( "ok\n" );
 746+ $this->output( "ok\n" );
747747 }
748748 }
749749
@@ -750,47 +750,47 @@
751751 $info = $this->db->indexInfo( 'filearchive', 'fa_user_timestamp', __METHOD__ );
752752 if ( !$info ) {
753753 $this->applyPatch( 'patch-filearchive-user-index.sql' );
754 - wfOut( "...filearchive indices updated\n" );
 754+ $this->output( "...filearchive indices updated\n" );
755755 }
756756 }
757757
758758 protected function doUniquePlTlIl() {
759759 $info = $this->db->indexInfo( 'pagelinks', 'pl_namespace' );
760760 if ( is_array( $info ) && !$info[0]->Non_unique ) {
761 - wfOut( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" );
 761+ $this->output( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" );
762762 return;
763763 }
764764
765 - wfOut( "Making pl_namespace, tl_namespace and il_to indices UNIQUE... " );
 765+ $this->output( "Making pl_namespace, tl_namespace and il_to indices UNIQUE... " );
766766 $this->applyPatch( 'patch-pl-tl-il-unique.sql' );
767 - wfOut( "ok\n" );
 767+ $this->output( "ok\n" );
768768 }
769769
770770 protected function renameEuWikiId() {
771771 if ( $this->db->fieldExists( 'external_user', 'eu_local_id' ) ) {
772 - wfOut( "...eu_wiki_id already renamed to eu_local_id.\n" );
 772+ $this->output( "...eu_wiki_id already renamed to eu_local_id.\n" );
773773 return;
774774 }
775775
776 - wfOut( "Renaming eu_wiki_id -> eu_local_id... " );
 776+ $this->output( "Renaming eu_wiki_id -> eu_local_id... " );
777777 $this->applyPatch( 'patch-eu_local_id.sql' );
778 - wfOut( "ok\n" );
 778+ $this->output( "ok\n" );
779779 }
780780
781781 protected function doUpdateMimeMinorField() {
782782 if ( $this->updateRowExists( 'mime_minor_length' ) ) {
783 - wfOut( "...*_mime_minor fields are already long enough.\n" );
 783+ $this->output( "...*_mime_minor fields are already long enough.\n" );
784784 return;
785785 }
786786
787 - wfOut( "Altering all *_mime_minor fields to 100 bytes in size ... " );
 787+ $this->output( "Altering all *_mime_minor fields to 100 bytes in size ... " );
788788 $this->applyPatch( 'patch-mime_minor_length.sql' );
789 - wfOut( "ok\n" );
 789+ $this->output( "ok\n" );
790790 }
791791
792792 protected function doPopulateRevLen() {
793793 if ( $this->updateRowExists( 'populate rev_len' ) ) {
794 - wfOut( "...rev_len column already populated.\n" );
 794+ $this->output( "...rev_len column already populated.\n" );
795795 return;
796796 }
797797
@@ -800,12 +800,12 @@
801801
802802 protected function doClFieldsUpdate() {
803803 if ( $this->updateRowExists( 'cl_fields_update' ) ) {
804 - wfOut( "...categorylinks up-to-date.\n" );
 804+ $this->output( "...categorylinks up-to-date.\n" );
805805 return;
806806 }
807807
808 - wfOut( 'Updating categorylinks (again)...' );
 808+ $this->output( 'Updating categorylinks (again)...' );
809809 $this->applyPatch( 'patch-categorylinks-better-collation2.sql' );
810 - wfOut( "done.\n" );
 810+ $this->output( "done.\n" );
811811 }
812812 }
Index: trunk/phase3/includes/installer/PostgresUpdater.php
@@ -387,14 +387,14 @@
388388
389389 protected function addSequence( $ns ) {
390390 if ( !$this->db->sequenceExists( $ns ) ) {
391 - wfOut( "Creating sequence $ns\n" );
 391+ $this->output( "Creating sequence $ns\n" );
392392 $this->db->query( "CREATE SEQUENCE $ns" );
393393 }
394394 }
395395
396396 protected function renameSequence( $old, $new ) {
397397 if ( $this->db->sequenceExists( $old ) ) {
398 - wfOut( "Renaming sequence $old to $new\n" );
 398+ $this->output( "Renaming sequence $old to $new\n" );
399399 $this->db->query( "ALTER SEQUENCE $old RENAME TO $new" );
400400 }
401401 }
@@ -402,10 +402,10 @@
403403 protected function addPgField( $table, $field, $type ) {
404404 $fi = $this->db->fieldInfo( $table, $field );
405405 if ( !is_null( $fi ) ) {
406 - wfOut( "... column \"$table.$field\" already exists\n" );
 406+ $this->output( "... column \"$table.$field\" already exists\n" );
407407 return;
408408 } else {
409 - wfOut( "Adding column \"$table.$field\"\n" );
 409+ $this->output( "Adding column \"$table.$field\"\n" );
410410 $this->db->query( "ALTER TABLE $table ADD $field $type" );
411411 }
412412 }
@@ -413,14 +413,14 @@
414414 protected function changeField( $table, $field, $newtype, $default ) {
415415 $fi = $this->db->fieldInfo( $table, $field );
416416 if ( is_null( $fi ) ) {
417 - wfOut( "... error: expected column $table.$field to exist\n" );
 417+ $this->output( "... error: expected column $table.$field to exist\n" );
418418 exit( 1 );
419419 }
420420
421421 if ( $fi->type() === $newtype )
422 - wfOut( "... column \"$table.$field\" is already of type \"$newtype\"\n" );
 422+ $this->output( "... column \"$table.$field\" is already of type \"$newtype\"\n" );
423423 else {
424 - wfOut( "Changing column type of \"$table.$field\" from \"{$fi->type()}\" to \"$newtype\"\n" );
 424+ $this->output( "Changing column type of \"$table.$field\" from \"{$fi->type()}\" to \"$newtype\"\n" );
425425 $sql = "ALTER TABLE $table ALTER $field TYPE $newtype";
426426 if ( strlen( $default ) ) {
427427 $res = array();
@@ -439,43 +439,43 @@
440440 protected function changeNullableField( $table, $field, $null ) {
441441 $fi = $this->db->fieldInfo( $table, $field );
442442 if ( is_null( $fi ) ) {
443 - wfOut( "... error: expected column $table.$field to exist\n" );
 443+ $this->output( "... error: expected column $table.$field to exist\n" );
444444 exit( 1 );
445445 }
446446 if ( $fi->nullable() ) {
447447 # # It's NULL - does it need to be NOT NULL?
448448 if ( 'NOT NULL' === $null ) {
449 - wfOut( "Changing \"$table.$field\" to not allow NULLs\n" );
 449+ $this->output( "Changing \"$table.$field\" to not allow NULLs\n" );
450450 $this->db->query( "ALTER TABLE $table ALTER $field SET NOT NULL" );
451451 } else {
452 - wfOut( "... column \"$table.$field\" is already set as NULL\n" );
 452+ $this->output( "... column \"$table.$field\" is already set as NULL\n" );
453453 }
454454 } else {
455455 # # It's NOT NULL - does it need to be NULL?
456456 if ( 'NULL' === $null ) {
457 - wfOut( "Changing \"$table.$field\" to allow NULLs\n" );
 457+ $this->output( "Changing \"$table.$field\" to allow NULLs\n" );
458458 $this->db->query( "ALTER TABLE $table ALTER $field DROP NOT NULL" );
459459 }
460460 else {
461 - wfOut( "... column \"$table.$field\" is already set as NOT NULL\n" );
 461+ $this->output( "... column \"$table.$field\" is already set as NOT NULL\n" );
462462 }
463463 }
464464 }
465465
466466 public function addPgIndex( $table, $index, $type ) {
467467 if ( $this->db->indexExists( $table, $index ) ) {
468 - wfOut( "... index \"$index\" on table \"$table\" already exists\n" );
 468+ $this->output( "... index \"$index\" on table \"$table\" already exists\n" );
469469 } else {
470 - wfOut( "Creating index \"$index\" on table \"$table\" $type\n" );
 470+ $this->output( "Creating index \"$index\" on table \"$table\" $type\n" );
471471 $this->db->query( "CREATE INDEX $index ON $table $type" );
472472 }
473473 }
474474
475475 public function addPgExtIndex( $table, $index, $type ) {
476476 if ( $this->db->indexExists( $table, $index ) ) {
477 - wfOut( "... index \"$index\" on table \"$table\" already exists\n" );
 477+ $this->output( "... index \"$index\" on table \"$table\" already exists\n" );
478478 } else {
479 - wfOut( "Creating index \"$index\" on table \"$table\"\n" );
 479+ $this->output( "Creating index \"$index\" on table \"$table\"\n" );
480480 if ( preg_match( '/^\(/', $type ) ) {
481481 $this->db->query( "CREATE INDEX $index ON $table $type" );
482482 } else {
@@ -487,13 +487,13 @@
488488 protected function changeFkeyDeferrable( $table, $field, $clause ) {
489489 $fi = $this->db->fieldInfo( $table, $field );
490490 if ( is_null( $fi ) ) {
491 - wfOut( "WARNING! Column \"$table.$field\" does not exist but it should! Please report this.\n" );
 491+ $this->output( "WARNING! Column \"$table.$field\" does not exist but it should! Please report this.\n" );
492492 return;
493493 }
494494 if ( $fi->is_deferred() && $fi->is_deferrable() ) {
495495 return;
496496 }
497 - wfOut( "Altering column \"$table.$field\" to be DEFERRABLE INITIALLY DEFERRED\n" );
 497+ $this->output( "Altering column \"$table.$field\" to be DEFERRABLE INITIALLY DEFERRED\n" );
498498 $conname = $fi->conname();
499499 $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
500500 $this->db->query( $command );
@@ -528,11 +528,11 @@
529529 }
530530
531531 if ( strpos( $search_path, $wgDBmwschema ) === false ) {
532 - wfOut( "Adding in schema \"$wgDBmwschema\" to search_path for user \"$wgDBuser\"\n" );
 532+ $this->output( "Adding in schema \"$wgDBmwschema\" to search_path for user \"$wgDBuser\"\n" );
533533 $search_path = "$wgDBmwschema, $search_path";
534534 }
535535 if ( strpos( $search_path, $wgDBts2schema ) === false ) {
536 - wfOut( "Adding in schema \"$wgDBts2schema\" to search_path for user \"$wgDBuser\"\n" );
 536+ $this->output( "Adding in schema \"$wgDBts2schema\" to search_path for user \"$wgDBuser\"\n" );
537537 $search_path = "$search_path, $wgDBts2schema";
538538 }
539539 $search_path = str_replace( ', ,', ',', $search_path );
@@ -541,7 +541,7 @@
542542 $this->db->doQuery( "SET search_path = $search_path" );
543543 } else {
544544 $path = $conf['search_path'];
545 - wfOut( "... search_path for user \"$wgDBuser\" looks correct ($path)\n" );
 545+ $this->output( "... search_path for user \"$wgDBuser\" looks correct ($path)\n" );
546546 }
547547
548548 $goodconf = array(
@@ -552,46 +552,46 @@
553553
554554 foreach ( $goodconf as $key => $value ) {
555555 if ( !array_key_exists( $key, $conf ) or $conf[$key] !== $value ) {
556 - wfOut( "Setting $key to '$value' for user \"$wgDBuser\"\n" );
 556+ $this->output( "Setting $key to '$value' for user \"$wgDBuser\"\n" );
557557 $this->db->doQuery( "ALTER USER $wgDBuser SET $key = '$value'" );
558558 $this->db->doQuery( "SET $key = '$value'" );
559559 } else {
560 - wfOut( "... default value of \"$key\" is correctly set to \"$value\" for user \"$wgDBuser\"\n" );
 560+ $this->output( "... default value of \"$key\" is correctly set to \"$value\" for user \"$wgDBuser\"\n" );
561561 }
562562 }
563563 }
564564
565565 protected function convertArchive2() {
566566 if ( $this->db->tableExists( "archive2" ) ) {
567 - wfOut( "Converting \"archive2\" back to normal archive table\n" );
 567+ $this->output( "Converting \"archive2\" back to normal archive table\n" );
568568 if ( $this->db->ruleExists( 'archive', 'archive_insert' ) ) {
569 - wfOut( "Dropping rule \"archive_insert\"\n" );
 569+ $this->output( "Dropping rule \"archive_insert\"\n" );
570570 $this->db->query( 'DROP RULE archive_insert ON archive' );
571571 }
572572 if ( $this->db->ruleExists( 'archive', 'archive_delete' ) ) {
573 - wfOut( "Dropping rule \"archive_delete\"\n" );
 573+ $this->output( "Dropping rule \"archive_delete\"\n" );
574574 $this->db->query( 'DROP RULE archive_delete ON archive' );
575575 }
576576 $this->applyPatch( 'patch-remove-archive2.sql' );
577577 } else {
578 - wfOut( "... obsolete table \"archive2\" does not exist\n" );
 578+ $this->output( "... obsolete table \"archive2\" does not exist\n" );
579579 }
580580 }
581581
582582 protected function checkOiDeleted() {
583583 if ( $this->db->fieldInfo( 'oldimage', 'oi_deleted' )->type() !== 'smallint' ) {
584 - wfOut( "Changing \"oldimage.oi_deleted\" to type \"smallint\"\n" );
 584+ $this->output( "Changing \"oldimage.oi_deleted\" to type \"smallint\"\n" );
585585 $this->db->query( "ALTER TABLE oldimage ALTER oi_deleted DROP DEFAULT" );
586586 $this->db->query( "ALTER TABLE oldimage ALTER oi_deleted TYPE SMALLINT USING (oi_deleted::smallint)" );
587587 $this->db->query( "ALTER TABLE oldimage ALTER oi_deleted SET DEFAULT 0" );
588588 } else {
589 - wfOut( "... column \"oldimage.oi_deleted\" is already of type \"smallint\"\n" );
 589+ $this->output( "... column \"oldimage.oi_deleted\" is already of type \"smallint\"\n" );
590590 }
591591 }
592592
593593 protected function checkOiNameConstraint() {
594594 if ( $this->db->hasConstraint( "oldimage_oi_name_fkey_cascaded" ) ) {
595 - wfOut( "... table \"oldimage\" has correct cascading delete/update foreign key to image\n" );
 595+ $this->output( "... table \"oldimage\" has correct cascading delete/update foreign key to image\n" );
596596 } else {
597597 if ( $this->db->hasConstraint( "oldimage_oi_name_fkey" ) ) {
598598 $this->db->query( "ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey" );
@@ -599,7 +599,7 @@
600600 if ( $this->db->hasConstraint( "oldimage_oi_name_fkey_cascade" ) ) {
601601 $this->db->query( "ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey_cascade" );
602602 }
603 - wfOut( "Making foreign key on table \"oldimage\" (to image) a cascade delete/update\n" );
 603+ $this->output( "Making foreign key on table \"oldimage\" (to image) a cascade delete/update\n" );
604604 $this->db->query( "ALTER TABLE oldimage ADD CONSTRAINT oldimage_oi_name_fkey_cascaded " .
605605 "FOREIGN KEY (oi_name) REFERENCES image(img_name) ON DELETE CASCADE ON UPDATE CASCADE" );
606606 }
@@ -607,66 +607,66 @@
608608
609609 protected function checkPageDeletedTrigger() {
610610 if ( !$this->db->triggerExists( 'page', 'page_deleted' ) ) {
611 - wfOut( "Adding function and trigger \"page_deleted\" to table \"page\"\n" );
 611+ $this->output( "Adding function and trigger \"page_deleted\" to table \"page\"\n" );
612612 $this->applyPatch( 'patch-page_deleted.sql' );
613613 } else {
614 - wfOut( "... table \"page\" has \"page_deleted\" trigger\n" );
 614+ $this->output( "... table \"page\" has \"page_deleted\" trigger\n" );
615615 }
616616 }
617617
618618 protected function checkRcCurIdNullable(){
619619 $fi = $this->db->fieldInfo( 'recentchanges', 'rc_cur_id' );
620620 if ( !$fi->nullable() ) {
621 - wfOut( "Removing NOT NULL constraint from \"recentchanges.rc_cur_id\"\n" );
 621+ $this->output( "Removing NOT NULL constraint from \"recentchanges.rc_cur_id\"\n" );
622622 $this->applyPatch( 'patch-rc_cur_id-not-null.sql' );
623623 } else {
624 - wfOut( "... column \"recentchanges.rc_cur_id\" has a NOT NULL constraint\n" );
 624+ $this->output( "... column \"recentchanges.rc_cur_id\" has a NOT NULL constraint\n" );
625625 }
626626 }
627627
628628 protected function checkPagelinkUniqueIndex() {
629629 $pu = $this->describeIndex( 'pagelink_unique' );
630630 if ( !is_null( $pu ) && ( $pu[0] != 'pl_from' || $pu[1] != 'pl_namespace' || $pu[2] != 'pl_title' ) ) {
631 - wfOut( "Dropping obsolete version of index \"pagelink_unique index\"\n" );
 631+ $this->output( "Dropping obsolete version of index \"pagelink_unique index\"\n" );
632632 $this->db->query( 'DROP INDEX pagelink_unique' );
633633 $pu = null;
634634 } else {
635 - wfOut( "... obsolete version of index \"pagelink_unique index\" does not exist\n" );
 635+ $this->output( "... obsolete version of index \"pagelink_unique index\" does not exist\n" );
636636 }
637637
638638 if ( is_null( $pu ) ) {
639 - wfOut( "Creating index \"pagelink_unique index\"\n" );
 639+ $this->output( "Creating index \"pagelink_unique index\"\n" );
640640 $this->db->query( 'CREATE UNIQUE INDEX pagelink_unique ON pagelinks (pl_from,pl_namespace,pl_title)' );
641641 } else {
642 - wfOut( "... index \"pagelink_unique_index\" already exists\n" );
 642+ $this->output( "... index \"pagelink_unique_index\" already exists\n" );
643643 }
644644 }
645645
646646 protected function checkRevUserFkey() {
647647 if ( $this->fkeyDeltype( 'revision_rev_user_fkey' ) == 'r' ) {
648 - wfOut( "... constraint \"revision_rev_user_fkey\" is ON DELETE RESTRICT\n" );
 648+ $this->output( "... constraint \"revision_rev_user_fkey\" is ON DELETE RESTRICT\n" );
649649 } else {
650 - wfOut( "Changing constraint \"revision_rev_user_fkey\" to ON DELETE RESTRICT\n" );
 650+ $this->output( "Changing constraint \"revision_rev_user_fkey\" to ON DELETE RESTRICT\n" );
651651 $this->applyPatch( 'patch-revision_rev_user_fkey.sql' );
652652 }
653653 }
654654
655655 protected function checkIpbAdress() {
656656 if ( $this->db->indexExists( 'ipblocks', 'ipb_address' ) ) {
657 - wfOut( "Removing deprecated index 'ipb_address'...\n" );
 657+ $this->output( "Removing deprecated index 'ipb_address'...\n" );
658658 $this->db->query( 'DROP INDEX ipb_address' );
659659 }
660660 if ( $this->db->indexExists( 'ipblocks', 'ipb_address_unique' ) ) {
661 - wfOut( "... have ipb_address_unique\n" );
 661+ $this->output( "... have ipb_address_unique\n" );
662662 } else {
663 - wfOut( "Adding ipb_address_unique index\n" );
 663+ $this->output( "Adding ipb_address_unique index\n" );
664664 $this->applyPatch( 'patch-ipb_address_unique.sql' );
665665 }
666666 }
667667
668668 protected function checkIwlPrefix() {
669669 if ( $this->db->indexExists( 'iwlinks', 'iwl_prefix' ) ) {
670 - wfOut( "Replacing index 'iwl_prefix' with 'iwl_prefix_from_title'...\n" );
 670+ $this->output( "Replacing index 'iwl_prefix' with 'iwl_prefix_from_title'...\n" );
671671 $this->applyPatch( 'patch-rename-iwl_prefix.sql' );
672672 }
673673 }
Index: trunk/phase3/includes/installer/SqliteUpdater.php
@@ -57,27 +57,27 @@
5858 protected function sqliteInitialIndexes() {
5959 // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer.
6060 if ( $this->updateRowExists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name' ) ) {
61 - wfOut( "...have initial indexes\n" );
 61+ $this->output( "...have initial indexes\n" );
6262 return;
6363 }
64 - wfOut( "Adding initial indexes..." );
 64+ $this->output( "Adding initial indexes..." );
6565 $this->applyPatch( 'initial-indexes.sql' );
66 - wfOut( "done\n" );
 66+ $this->output( "done\n" );
6767 }
6868
6969 protected function sqliteSetupSearchindex() {
7070 $module = $this->db->getFulltextSearchModule();
7171 $fts3tTable = $this->updateRowExists( 'fts3' );
7272 if ( $fts3tTable && !$module ) {
73 - wfOut( '...PHP is missing FTS3 support, downgrading tables...' );
 73+ $this->output( '...PHP is missing FTS3 support, downgrading tables...' );
7474 $this->applyPatch( 'searchindex-no-fts.sql' );
75 - wfOut( "done\n" );
 75+ $this->output( "done\n" );
7676 } elseif ( !$fts3tTable && $module == 'FTS3' ) {
77 - wfOut( '...adding FTS3 search capabilities...' );
 77+ $this->output( '...adding FTS3 search capabilities...' );
7878 $this->applyPatch( 'searchindex-fts3.sql' );
79 - wfOut( "done\n" );
 79+ $this->output( "done\n" );
8080 } else {
81 - wfOut( "...fulltext search table appears to be in order.\n" );
 81+ $this->output( "...fulltext search table appears to be in order.\n" );
8282 }
8383 }
8484 }

Status & tagging log