r13524 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13523‎ | r13524 | r13525 >
Date:10:06, 6 April 2006
Author:tstarling
Status:old
Tags:
Comment:
Don't use paths relative to the current directory, the current directory is no longer set in commandLine.inc. Rightly so, the previous behaviour was annoying.
Modified paths:
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -135,7 +135,7 @@
136136
137137 function do_interwiki_update() {
138138 # Check that interwiki table exists; if it doesn't source it
139 - global $wgDatabase;
 139+ global $wgDatabase, $IP;
140140 if( $wgDatabase->tableExists( "interwiki" ) ) {
141141 echo "...already have interwiki table\n";
142142 return true;
@@ -144,7 +144,7 @@
145145 dbsource( archive("patch-interwiki.sql") );
146146 echo "ok\n";
147147 echo "Adding default interwiki definitions: ";
148 - dbsource( "maintenance/interwiki.sql" );
 148+ dbsource( "$IP/maintenance/interwiki.sql" );
149149 echo "ok\n";
150150 }
151151
@@ -207,7 +207,7 @@
208208 } else {
209209 echo "Adding wl_notificationtimestamp field for email notification management.";
210210 /* ALTER TABLE watchlist ADD (wl_notificationtimestamp varchar(14) binary NOT NULL default '0'); */
211 - dbsource( "maintenance/archives/patch-email-notification.sql", $wgDatabase );
 211+ dbsource( archive( 'patch-email-notification.sql' ), $wgDatabase );
212212 echo "ok\n";
213213 }
214214 # Check if we need to add talk page rows to the watchlist
@@ -273,7 +273,7 @@
274274 global $wgDatabase;
275275 if( $wgDatabase->fieldExists( 'user', 'user_emailauthenticationtimestamp' ) ) {
276276 echo "User table contains old email authentication field. Dropping... ";
277 - dbsource( "maintenance/archives/patch-email-authentication.sql", $wgDatabase );
 277+ dbsource( archive( 'patch-email-authentication.sql' ), $wgDatabase );
278278 echo "ok\n";
279279 } else {
280280 echo "...user table does not contain old email authentication field.\n";
@@ -297,7 +297,7 @@
298298 echo "Logging table has correct title encoding.\n";
299299 } else {
300300 echo "Fixing title encoding on logging table... ";
301 - dbsource( 'maintenance/archives/patch-logging-title.sql', $wgDatabase );
 301+ dbsource( archive( 'patch-logging-title.sql' ), $wgDatabase );
302302 echo "ok\n";
303303 }
304304 }
@@ -472,7 +472,7 @@
473473 $fname="do_schema_restructuring";
474474 if( $wgDatabase->fieldExists( 'revision', 'inverse_timestamp' ) ) {
475475 echo "Removing revision.inverse_timestamp and fixing indexes... ";
476 - dbsource( 'maintenance/archives/patch-inverse_timestamp.sql', $wgDatabase );
 476+ dbsource( archive( 'patch-inverse_timestamp.sql' ), $wgDatabase );
477477 echo "ok\n";
478478 } else {
479479 echo "revision timestamp indexes already up to 2005-03-13\n";
@@ -485,7 +485,7 @@
486486 echo "...rev_text_id already in place.\n";
487487 } else {
488488 echo "Adding rev_text_id field... ";
489 - dbsource( 'maintenance/archives/patch-rev_text_id.sql', $wgDatabase );
 489+ dbsource( archive( 'patch-rev_text_id.sql' ), $wgDatabase );
490490 echo "ok\n";
491491 }
492492 }
@@ -534,7 +534,7 @@
535535 echo "...already have pagelinks table.\n";
536536 } else {
537537 echo "Converting links and brokenlinks tables to pagelinks... ";
538 - dbsource( "maintenance/archives/patch-pagelinks.sql", $wgDatabase );
 538+ dbsource( archive( 'patch-pagelinks.sql' ), $wgDatabase );
539539 echo "ok\n";
540540 flush();
541541
@@ -573,7 +573,7 @@
574574
575575 if( $wgDatabase->fieldExists( 'image', 'img_type' ) ) {
576576 echo "Dropping unused img_type field in image table... ";
577 - dbsource( "maintenance/archives/patch-drop_img_type.sql", $wgDatabase );
 577+ dbsource( archive( 'patch-drop_img_type.sql' ), $wgDatabase );
578578 echo "ok\n";
579579 } else {
580580 echo "No img_type field in image table; Good.\n";
@@ -599,7 +599,7 @@
600600 echo "WARNING: This next step will probably fail due to unfixed duplicates...\n";
601601 }
602602 echo "Adding unique index on user_name... ";
603 - dbsource( 'maintenance/archives/patch-user_nameindex.sql', $wgDatabase );
 603+ dbsource( archive( 'patch-user_nameindex.sql' ), $wgDatabase );
604604 echo "ok\n";
605605 }
606606 }
@@ -614,13 +614,13 @@
615615 }
616616
617617 echo "Adding user_groups table... ";
618 - dbsource( 'maintenance/archives/patch-user_groups.sql', $wgDatabase );
 618+ dbsource( archive( 'patch-user_groups.sql' ), $wgDatabase );
619619 echo "ok\n";
620620
621621 if( !$wgDatabase->tableExists( 'user_rights' ) ) {
622622 if( $wgDatabase->fieldExists( 'user', 'user_rights' ) ) {
623623 echo "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion...";
624 - dbsource( 'maintenance/archives/patch-user_rights.sql', $wgDatabase );
 624+ dbsource( archive( 'patch-user_rights.sql' ), $wgDatabase );
625625 echo "ok\n";
626626 } else {
627627 echo "*** WARNING: couldn't locate user_rights table or field for upgrade.\n";
@@ -666,7 +666,7 @@
667667 echo "ok\n";
668668
669669 echo "Re-adding fresh user_groups table... ";
670 - dbsource( 'maintenance/archives/patch-user_groups.sql', $wgDatabase );
 670+ dbsource( archive( 'patch-user_groups.sql' ), $wgDatabase );
671671 echo "ok\n";
672672
673673 echo "***\n";

Status & tagging log