3use Psr\Log\LoggerInterface;
41 ObjectCache::getMainWANInstance(),
42 ObjectCache::getLocalClusterInstance(),
43 [ $this,
'getTitleChangeEvents' ],
44 [ $this,
'getEventAffectedKeys' ],
46 'channel' =>
'table:recentchanges:' . $this->db->getDomainID(),
47 'logger' => $this->logger
51 $reaper->invoke( 100 );
71 [
'rc_namespace',
'rc_title',
'rc_timestamp',
'rc_id' ],
74 "rc_timestamp > $encStart",
75 "rc_timestamp = $encStart AND rc_id > " .
$db->
addQuotes( $id )
77 "rc_timestamp < $encEnd"
80 [
'ORDER BY' =>
'rc_timestamp ASC, rc_id ASC',
'LIMIT' => $limit ]
84 foreach (
$res as $row ) {
86 'id' => (int)$row->rc_id,
87 'pos' => (
int)
wfTimestamp( TS_UNIX, $row->rc_timestamp ),
88 'item' =>
new TitleValue( (
int)$row->rc_namespace, $row->rc_title )
110 if (
$t->getNamespace() >= 0 ) {
111 $entities[] = WikiPage::factory( Title::newFromTitleValue(
$t ) );
117 if (
$t->inNamespace( NS_USER ) ) {
122 foreach ( $entities as $entity ) {
128 $this->logger->debug( __CLASS__ .
': got key(s) ' . implode(
', ',
$keys ) );
wfLocalFile( $title)
Get an object referring to a locally registered file.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Represents a page (or page fragment) title within MediaWiki.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Class for fixing stale WANObjectCache keys using a purge event source.
doUpdate()
Perform the actual work.
getTitleChangeEvents( $start, $id, $end, $limit)
__construct(IDatabase $db, LoggerInterface $logger)
getEventAffectedKeys(WANObjectCache $cache, TitleValue $t)
Gets a list of important cache keys associated with a title.
Class for scanning through chronological, log-structured data or change logs and locally purging cach...
Multi-datacenter aware caching interface.
Interface that deferrable updates should implement.