X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteSelfExternals.php;h=ab257846bd0c9d778f17447cc4160660bebf3c9e;hb=817baf7e91393e21af8607da549ca2ef2e3d2736;hp=a3976634f3572e958517c4adb729d2445595b7fe;hpb=fa8e1a9b00d872f445b65312f554db03230a5502;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteSelfExternals.php b/maintenance/deleteSelfExternals.php index a3976634f3..ab257846bd 100644 --- a/maintenance/deleteSelfExternals.php +++ b/maintenance/deleteSelfExternals.php @@ -32,19 +32,19 @@ require_once __DIR__ . '/Maintenance.php'; class DeleteSelfExternals extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = 'Delete self-references to $wgServer from externallinks'; - $this->mBatchSize = 1000; + $this->addDescription( 'Delete self-references to $wgServer from externallinks' ); + $this->setBatchSize( 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(); $this->commitTransaction( $db, __METHOD__ ); $q = $db->limitResult( "DELETE /* deleteSelfExternals */ FROM externallinks WHERE el_to" - . $db->buildLike( $wgServer . '/', $db->anyString() ), $this->mBatchSize ); + . $db->buildLike( $wgServer . '/', $db->anyString() ), $this->getBatchSize() ); $this->output( "Deleting a batch\n" ); $db->query( $q ); if ( !$db->affectedRows() ) {