if ( !defined( 'MEDIAWIKI' ) ) {
$optionsWithArgs = array( 'm' );
- require_once( dirname(__FILE__) . '/../commandLine.inc' );
+ require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
resolveStubs();
}
for ( $b = 0; $b < $numBlocks; $b++ ) {
wfWaitForSlaves( 2 );
-
+
printf( "%5.2f%%\n", $b / $numBlocks * 100 );
- $start = intval($maxID / $numBlocks) * $b + 1;
- $end = intval($maxID / $numBlocks) * ($b + 1);
-
+ $start = intval( $maxID / $numBlocks ) * $b + 1;
+ $end = intval( $maxID / $numBlocks ) * ( $b + 1 );
+
$res = $dbr->select( 'text', array( 'old_id', 'old_text', 'old_flags' ),
"old_id>=$start AND old_id<=$end " .
- "AND old_flags LIKE '%object%' AND old_flags NOT LIKE '%external%' ".
- 'AND LOWER(CONVERT(LEFT(old_text,22) USING latin1)) = \'o:15:"historyblobstub"\'',
+ "AND old_flags LIKE '%object%' AND old_flags NOT LIKE '%external%' " .
+ 'AND LOWER(CONVERT(LEFT(old_text,22) USING latin1)) = \'o:15:"historyblobstub"\'',
$fname );
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
resolveStub( $row->old_id, $row->old_text, $row->old_flags );
}
- $dbr->freeResult( $res );
-
-
}
print "100%\n";
}
}
# Update the row
- #print "oldid=$id\n";
+ # print "oldid=$id\n";
$dbw->update( 'text',
array( /* SET */
'old_flags' => $newFlags,