r72147 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72146‎ | r72147 | r72148 >
Date:18:52, 1 September 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
Deprecate archive() in favor of DatabaseBase::patchPath()
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -103,12 +103,8 @@
104104 }
105105
106106 function archive( $name ) {
107 - global $wgDBtype, $IP;
108 - if ( file_exists( "$IP/maintenance/$wgDBtype/archives/$name" ) ) {
109 - return "$IP/maintenance/$wgDBtype/archives/$name";
110 - } else {
111 - return "$IP/maintenance/archives/$name";
112 - }
 107+ wfDeprecated( __FUNCTION__ );
 108+ return DatabaseBase::patchPath( $name );
113109 }
114110
115111 function do_interwiki_update() {
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -165,7 +165,7 @@
166166 if ( $isFullPath ) {
167167 $this->db->sourceFile( $path );
168168 } else {
169 - $this->db->sourceFile( archive( $path ) );
 169+ $this->db->sourceFile( DatabaseBase::patchPath( $path ) );
170170 }
171171 }
172172
Index: trunk/phase3/includes/installer/PostgresUpdater.php
@@ -564,7 +564,7 @@
565565 wfOut( "Dropping rule \"archive_delete\"\n" );
566566 $this->db->query( 'DROP RULE archive_delete ON archive' );
567567 }
568 - $this->db->sourceFile( archive( 'patch-remove-archive2.sql' ) );
 568+ $this->applyPatch( 'patch-remove-archive2.sql' );
569569 } else {
570570 wfOut( "... obsolete table \"archive2\" does not exist\n" );
571571 }

Comments

#Comment by MZMcBride (talk | contribs)   21:55, 6 September 2010

This appears to have been (partially) reverted in r72308.

#Comment by 😂 (talk | contribs)   21:58, 6 September 2010

And correctly so, I didn't clean up archive() as well as I should've.

Status & tagging log