X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupWatchlist.php;h=9728ac5ded89eb75118647e88c6b030ab9eb1ab4;hb=a0947c9507065a83afe52b078f0f6d1c6163875e;hp=eb7d7b189585e0d0aab8eda23f116aaeb4bd2581;hpb=b2645d82849ca74b0e6b8df6a3e28e81d0561a58;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupWatchlist.php b/maintenance/cleanupWatchlist.php index eb7d7b1895..9728ac5ded 100644 --- a/maintenance/cleanupWatchlist.php +++ b/maintenance/cleanupWatchlist.php @@ -37,16 +37,16 @@ require_once __DIR__ . '/cleanupTable.inc'; * @ingroup Maintenance */ class WatchlistCleanup extends TableCleanup { - protected $defaultParams = array( + protected $defaultParams = [ 'table' => 'watchlist', - 'index' => array( 'wl_user', 'wl_namespace', 'wl_title' ), - 'conds' => array(), + 'index' => [ 'wl_user', 'wl_namespace', 'wl_title' ], + 'conds' => [], 'callback' => 'processRow' - ); + ]; public function __construct() { parent::__construct(); - $this->mDescription = "Script to remove broken, unparseable titles in the Watchlist"; + $this->addDescription( 'Script to remove broken, unparseable titles in the Watchlist' ); $this->addOption( 'fix', 'Actually remove entries; without will only report.' ); } @@ -77,12 +77,12 @@ class WatchlistCleanup extends TableCleanup { private function removeWatch( $row ) { if ( !$this->dryrun && $this->hasOption( 'fix' ) ) { - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); $dbw->delete( - 'watchlist', array( + 'watchlist', [ 'wl_user' => $row->wl_user, 'wl_namespace' => $row->wl_namespace, - 'wl_title' => $row->wl_title ), + 'wl_title' => $row->wl_title ], __METHOD__ );