for Internet Explorer's sake and standards compliance
* (bug 13298) Tighter limits on Special:Newpages limits when embedding
* Email subject in content language instead of sending user's UI language
+* (bug 13251) Allow maintenance rebuild scripts to work with Postgres
=== API changes in 1.13 ===
* @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;
}
* @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;
}
require_once( "rebuildtextindex.inc" );
require_once( "rebuildrecentchanges.inc" );
-$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
-
-print "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n";
-dropTextIndex( $database );
-rebuildTextIndex( $database );
-createTextIndex( $database );
+$dbclass = 'Database' . ucfirst( $wgDBtype ) ;
+$database = new $dbclass( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+
+if ($wgDBtype == 'mysql') {
+ print "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n";
+ dropTextIndex( $database );
+ rebuildTextIndex( $database );
+ createTextIndex( $database );
+}
print "\n\n** Rebuilding recentchanges table:\n";
rebuildRecentChangesTable();