10require_once __DIR__ .
'/Maintenance.php';
16 parent::__construct();
17 $this->
addDescription(
'Removes expired items from the watchlist and watchlist_expiry tables.' );
26 if ( !$this->
getServiceContainer()->getMainConfig()->
get( MainConfigNames::WatchlistExpiry ) ) {
27 $this->
error(
"Watchlist expiry is not enabled. Set `\$wgWatchlistExpiry = true;` to enable." );
33 $count = $watchedItemStore->countExpired();
34 $this->
output( $count .
" expired watchlist entries found.\n" );
39 while ( $watchedItemStore->countExpired() > 0 ) {
40 $watchedItemStore->removeExpired( $this->
getBatchSize(),
true );
44 $this->
output(
"All expired entries purged.\n" );
51require_once RUN_MAINTENANCE_IF_MAIN;
A class containing constants representing the names of configuration variables.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
getBatchSize()
Returns batch size.
output( $out, $channel=null)
Throw some output to the user.
error( $err, $die=0)
Throw an error to the user.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.
execute()
Do the actual work.All child classes will need to implement thisbool|null|void True for success,...
__construct()
Default constructor.