2009-09-12 00:05:04 +00:00
|
|
|
<?php
|
2009-09-12 00:02:57 +00:00
|
|
|
|
|
|
|
|
require_once("commandLine.inc");
|
|
|
|
|
|
|
|
|
|
print "Deleting self externals from $wgServer\n";
|
|
|
|
|
$db = wfGetDB(DB_MASTER);
|
|
|
|
|
while (1) {
|
|
|
|
|
wfWaitForSlaves( 2 );
|
|
|
|
|
$db->commit();
|
2009-10-21 19:53:03 +00:00
|
|
|
$q = $db->limitResult( "DELETE /* deleteSelfExternals */ FROM externallinks WHERE el_to"
|
|
|
|
|
. $db->buildLike( $wgServer . '/', $db->anyString() ), 1000 );
|
2009-09-12 00:02:57 +00:00
|
|
|
print "Deleting a batch\n";
|
|
|
|
|
$db->query($q);
|
|
|
|
|
if (!$db->affectedRows()) exit(0);
|
|
|
|
|
}
|