diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-05-16 20:58:53 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-05-16 20:58:53 +0000 |
commit | cecb985bee3bdd252e1b8dc0bd500b37cd52be01 (patch) | |
tree | 17266aa237742640aabee7856f0202317a45d540 /maintenance/storage/resolveStubs.php | |
parent | 0bac06c301f2a83edb0236e4c2434da16848d549 (diff) |
Aktualisierung auf MediaWiki 1.10.0
Plugins angepasst und verbessert
kleine Korrekturen am Design
Diffstat (limited to 'maintenance/storage/resolveStubs.php')
-rw-r--r-- | maintenance/storage/resolveStubs.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/maintenance/storage/resolveStubs.php b/maintenance/storage/resolveStubs.php index e93d5c97..6836ae60 100644 --- a/maintenance/storage/resolveStubs.php +++ b/maintenance/storage/resolveStubs.php @@ -5,7 +5,7 @@ define( 'REPORTING_INTERVAL', 100 ); if ( !defined( 'MEDIAWIKI' ) ) { $optionsWithArgs = array( 'm' ); - require_once( '../commandLine.inc' ); + require_once( dirname(__FILE__) . '/../commandLine.inc' ); require_once( 'includes/ExternalStoreDB.php' ); resolveStubs(); @@ -18,21 +18,17 @@ if ( !defined( 'MEDIAWIKI' ) ) { function resolveStubs() { $fname = 'resolveStubs'; - $dbr =& wfGetDB( DB_SLAVE ); - $dbw =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); $maxID = $dbr->selectField( 'text', 'MAX(old_id)', false, $fname ); $blockSize = 10000; $numBlocks = intval( $maxID / $blockSize ) + 1; for ( $b = 0; $b < $numBlocks; $b++ ) { - wfWaitForSlaves( 5 ); + wfWaitForSlaves( 2 ); printf( "%5.2f%%\n", $b / $numBlocks * 100 ); $start = intval($maxID / $numBlocks) * $b + 1; $end = intval($maxID / $numBlocks) * ($b + 1); - $stubs = array(); - $flagsArray = array(); - $res = $dbr->select( 'text', array( 'old_id', 'old_text', 'old_flags' ), "old_id>=$start AND old_id<=$end " . @@ -40,7 +36,7 @@ function resolveStubs() { #"AND old_flags LIKE '%object%' AND old_flags NOT LIKE '%external%' ". "AND old_flags='object' " . - "AND old_text LIKE 'O:15:\"historyblobstub\"%'", $fname ); + "AND LOWER(LEFT(old_text,22)) = 'O:15:\"historyblobstub\"'", $fname ); while ( $row = $dbr->fetchObject( $res ) ) { resolveStub( $row->old_id, $row->old_text, $row->old_flags ); } @@ -60,8 +56,8 @@ function resolveStub( $id, $stubText, $flags ) { $stub = unserialize( $stubText ); $flags = explode( ',', $flags ); - $dbr =& wfGetDB( DB_SLAVE ); - $dbw =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); if ( strtolower( get_class( $stub ) ) !== 'historyblobstub' ) { print "Error found object of class " . get_class( $stub ) . ", expecting historyblobstub\n"; @@ -87,6 +83,7 @@ function resolveStub( $id, $stubText, $flags ) { } # Update the row + #print "oldid=$id\n"; $dbw->update( 'text', array( /* SET */ 'old_flags' => $newFlags, |