diff options
Diffstat (limited to 'maintenance/FiveUpgrade.inc')
-rw-r--r-- | maintenance/FiveUpgrade.inc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/maintenance/FiveUpgrade.inc b/maintenance/FiveUpgrade.inc index 9a882bc6..7ae8f5d0 100644 --- a/maintenance/FiveUpgrade.inc +++ b/maintenance/FiveUpgrade.inc @@ -1,4 +1,8 @@ <?php +/** + * @file + * @ingroup Maintenance + */ require_once( 'cleanupDupes.inc' ); require_once( 'userDupes.inc' ); @@ -9,6 +13,9 @@ define( 'MW_UPGRADE_ENCODE', true ); define( 'MW_UPGRADE_NULL', null ); define( 'MW_UPGRADE_CALLBACK', null ); // for self-documentation only +/** + * @ingroup Maintenance + */ class FiveUpgrade { function FiveUpgrade() { $this->conversionTables = $this->prepareWindows1252(); @@ -61,9 +68,10 @@ class FiveUpgrade { * @access private */ function &newConnection() { - global $wgDBadminuser, $wgDBadminpassword; + global $wgDBadminuser, $wgDBadminpassword, $wgDBtype; global $wgDBserver, $wgDBname; - $db = new Database( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); + $dbclass = 'Database' . ucfirst( $wgDBtype ) ; + $db = new $dbclass( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); return $db; } @@ -75,11 +83,15 @@ class FiveUpgrade { * @access private */ function &streamConnection() { + global $wgDBtype; + $timeout = 3600 * 24; $db =& $this->newConnection(); $db->bufferResults( false ); - $db->query( "SET net_read_timeout=$timeout" ); - $db->query( "SET net_write_timeout=$timeout" ); + if ($wgDBtype == 'mysql') { + $db->query( "SET net_read_timeout=$timeout" ); + $db->query( "SET net_write_timeout=$timeout" ); + } return $db; } @@ -702,7 +714,7 @@ END; 'major' => '', 'minor' => '' ); - $magic =& wfGetMimeMagic(); + $magic = MimeMagic::singleton(); $mime = $magic->guessMimeType( $filename, true ); list( $info['major'], $info['minor'] ) = explode( '/', $mime ); @@ -1165,5 +1177,3 @@ ENDS; } } - -?> |