Go to the documentation of this file.
5 use Psr\Log\LoggerInterface;
43 MediaWikiServices::getInstance()->getMainWANObjectCache(),
45 [ $this,
'getTitleChangeEvents' ],
46 [ $this,
'getEventAffectedKeys' ],
48 'channel' =>
'table:recentchanges:' . $this->db->getDomainID(),
73 [
'rc_namespace',
'rc_title',
'rc_timestamp',
'rc_id' ],
76 "rc_timestamp > $encStart",
77 "rc_timestamp = $encStart AND rc_id > " .
$db->
addQuotes( $id )
79 "rc_timestamp < $encEnd"
82 [
'ORDER BY' =>
'rc_timestamp ASC, rc_id ASC',
'LIMIT' => $limit ]
86 foreach (
$res as $row ) {
88 'id' => (int)$row->rc_id,
89 'pos' => (
int)
wfTimestamp( TS_UNIX, $row->rc_timestamp ),
90 'item' =>
new TitleValue( (
int)$row->rc_namespace, $row->rc_title )
112 if (
$t->getNamespace() >= 0 ) {
117 $entities[] = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
118 ->newFile(
$t->getText() );
125 foreach ( $entities as $entity ) {
131 $this->logger->debug( __CLASS__ .
': got key(s) ' . implode(
', ',
$keys ) );
__construct(IDatabase $db, LoggerInterface $logger)
static getLocalClusterInstance()
Get the main cluster-local cache object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Class for fixing stale WANObjectCache keys using a purge event source.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getTitleChangeEvents( $start, $id, $end, $limit)
getEventAffectedKeys(WANObjectCache $cache, LinkTarget $t)
Gets a list of important cache keys associated with a title.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Multi-datacenter aware caching interface.
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
invoke( $n=100)
Check and reap stale keys based on a chunk of events.
Class for scanning through chronological, log-structured data or change logs and locally purging cach...
doUpdate()
Perform the actual work.
Interface that deferrable updates should implement.
Represents a page (or page fragment) title within MediaWiki.