summaryrefslogtreecommitdiff
path: root/maintenance/FiveUpgrade.inc
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
commit370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch)
tree491674f4c242e4d6ba0d04eafa305174c35a3391 /maintenance/FiveUpgrade.inc
parentf4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff)
Update auf 1.13.0
Diffstat (limited to 'maintenance/FiveUpgrade.inc')
-rw-r--r--maintenance/FiveUpgrade.inc24
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;
}
}
-
-?>