From: Max Semenik Date: Mon, 11 Oct 2010 15:29:48 +0000 (+0000) Subject: Turned Database::patchPath() into a member function, less globals to care about X-Git-Tag: 1.31.0-rc.0~34540 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=797bc0c5f77812a61982c47485ee5c7abd6688b4;p=lhc%2Fweb%2Fwiklou.git Turned Database::patchPath() into a member function, less globals to care about --- diff --git a/includes/db/Database.php b/includes/db/Database.php index e249ccb2a0..d29d142f70 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2412,11 +2412,12 @@ abstract class DatabaseBase implements DatabaseType { * @param $patch String The name of the patch, like patch-something.sql * @return String Full path to patch file */ - public static function patchPath( $patch ) { - global $wgDBtype, $IP; + public function patchPath( $patch ) { + global $IP; - if ( file_exists( "$IP/maintenance/$wgDBtype/archives/$patch" ) ) { - return "$IP/maintenance/$wgDBtype/archives/$patch"; + $dbType = $this->getType(); + if ( file_exists( "$IP/maintenance/$dbType/archives/$patch" ) ) { + return "$IP/maintenance/$dbType/archives/$patch"; } else { return "$IP/maintenance/archives/$patch"; } diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 8a32808eb0..bb7bf1171e 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -274,7 +274,7 @@ abstract class DatabaseUpdater { if ( $isFullPath ) { $this->db->sourceFile( $path ); } else { - $this->db->sourceFile( DatabaseBase::patchPath( $path ) ); + $this->db->sourceFile( $this->db->patchPath( $path ) ); } }