Jump to content
MediaWiki

Manual:purgeExpiredWatchlistItems.php

From mediawiki.org
MediaWiki version:
≥ 1.35
MediaWiki file: purgeExpiredWatchlistItems.php
Location: maintenance/
Source code: master1.46.01.45.41.43.9
Classes: PurgeExpiredWatchlistItems

Details

[edit ]

purgeExpiredWatchlistItems.php is a maintenance script that deletes expired rows from the watchlist and watchlist_expiry database tables.

This script should be run periodically, for example, by a cron job. The recommended periodicity is once or twice a day, to account for users on different timezones. For improved site performance, $wgWatchlistPurgeRate can be set to 0.

Options

[edit ]

This script doesn't have any of its own parameters, and the most useful of the generic parameters is probably --batch-size, which determines how many rows will be deleted on each run (defaults to 500).

Usage

[edit ]
phpmaintenance/run.phppurgeExpiredWatchlistItems
Terminal
$ php maintenance/run.php purgeExpiredWatchlistItems
7 expired watchlist entries found.
All expired entries purged.
In MediaWiki version MediaWiki 1.39 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

Common error

[edit ]
Watchlist expiry is not enabled.

An error is thrown if $wgWatchlistExpiry is not true. Set $wgWatchlistExpiry = true; to enable.

See also

[edit ]
Watchlists
API modules
Configuration settings
Database tables
Help pages
Hooks
Jobs
Maintenance scripts
Special pages

AltStyle によって変換されたページ (->オリジナル) /