25if ( !defined(
'MEDIAWIKI' ) ) {
28 require_once __DIR__ .
'/../commandLine.inc';
41 $maxID =
$dbr->selectField(
'text',
'MAX(old_id)',
'',
$fname );
43 $numBlocks =
intval( $maxID / $blockSize ) + 1;
48 printf(
"%5.2f%%\n", $b / $numBlocks * 100 );
49 $start =
intval( $maxID / $numBlocks ) * $b + 1;
50 $end =
intval( $maxID / $numBlocks ) * ( $b + 1 );
52 $res =
$dbr->select(
'text', [
'old_id',
'old_text',
'old_flags' ],
53 "old_id>=$start AND old_id<=$end " .
54 "AND old_flags LIKE '%object%' AND old_flags NOT LIKE '%external%' " .
55 'AND LOWER(CONVERT(LEFT(old_text,22) USING latin1)) = \'o:15:"historyblobstub"\'',
57 foreach (
$res as $row ) {
58 resolveStub( $row->old_id, $row->old_text, $row->old_flags );
74 $flags = explode(
',', $flags );
80 print "Error found object of class " .
get_class( $stub ) .
", expecting historyblobstub\n";
85 # Get the (maybe) external row
86 $externalRow =
$dbr->selectRow(
90 'old_id' => $stub->mOldId,
91 'old_flags' .
$dbr->buildLike(
$dbr->anyString(),
'external',
$dbr->anyString() )
96 if ( !$externalRow ) {
97 # Object wasn't external
101 # Preserve the legacy encoding flag, but switch from object to external
102 if (
in_array(
'utf-8', $flags ) ) {
103 $newFlags =
'external,utf-8';
105 $newFlags =
'external';
109 # print "oldid=$id\n";
110 $dbw->update(
'text',
112 'old_flags' => $newFlags,
113 'old_text' => $externalRow->old_text .
'/' . $stub->mHash
unserialize( $serialized)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfWaitForSlaves( $ifWritesSince=null, $wiki=false, $cluster=false, $timeout=null)
Waits for the replica DBs to catch up to the master position.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
while(( $__line=Maintenance::readconsole()) !==false) print
resolveStub( $id, $stubText, $flags)
Resolve a history stub.
if(!defined('MEDIAWIKI')) resolveStubs()
Convert history stubs that point to an external row to direct external pointers.