X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteSelfExternals.php;h=ed15fd13b34218b00e33b90c5b87fac2f0a91024;hb=fd8d75c1fd26e9ca0976111f1b3861935a53f84b;hp=a0976228150b8806f8d8ec419ed18c4750edbec5;hpb=5c5fb511c70346a660cb6aa388cc677e11d3bdab;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteSelfExternals.php b/maintenance/deleteSelfExternals.php index a097622815..ed15fd13b3 100644 --- a/maintenance/deleteSelfExternals.php +++ b/maintenance/deleteSelfExternals.php @@ -32,17 +32,17 @@ require_once __DIR__ . '/Maintenance.php'; class DeleteSelfExternals extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = 'Delete self-references to $wgServer from externallinks'; + $this->addDescription( 'Delete self-references to $wgServer from externallinks' ); $this->mBatchSize = 1000; } public function execute() { global $wgServer; $this->output( "Deleting self externals from $wgServer\n" ); - $db = wfGetDB( DB_MASTER ); + $db = $this->getDB( DB_MASTER ); while ( 1 ) { wfWaitForSlaves(); - $db->commit( __METHOD__ ); + $this->commitTransaction( $db, __METHOD__ ); $q = $db->limitResult( "DELETE /* deleteSelfExternals */ FROM externallinks WHERE el_to" . $db->buildLike( $wgServer . '/', $db->anyString() ), $this->mBatchSize ); $this->output( "Deleting a batch\n" );