MediaWiki REL1_35
|
Storage layer class for WatchedItems. More...
Public Member Functions | |||||||
__construct (ServiceOptions $options, ILBFactory $lbFactory, JobQueueGroup $queueGroup, BagOStuff $stash, HashBagOStuff $cache, ReadOnlyMode $readOnlyMode, NamespaceInfo $nsInfo, RevisionLookup $revisionLookup, HookContainer $hookContainer) | |||||||
addWatch (UserIdentity $user, LinkTarget $target, ?string $expiry=null) | |||||||
addWatchBatchForUser (UserIdentity $user, array $targets, ?string $expiry=null) | |||||||
Add multiple items to the user's watchlist. | |||||||
clearUserWatchedItems (UserIdentity $user) | |||||||
Deletes ALL watched items for the given user when under $updateRowsPerQuery entries exist. | |||||||
clearUserWatchedItemsUsingJobQueue (UserIdentity $user) | |||||||
Queues a job that will clear the users watchlist using the Job Queue. | |||||||
countExpired () | |||||||
Get the number of watchlist items that expire before the current time.
| |||||||
countUnreadNotifications (UserIdentity $user, $unreadLimit=null) | |||||||
countVisitingWatchers (LinkTarget $target, $threshold) | |||||||
countVisitingWatchersMultiple (array $targetsWithVisitThresholds, $minimumWatchers=null) | |||||||
countWatchedItems (UserIdentity $user) | |||||||
countWatchers (LinkTarget $target) | |||||||
countWatchersMultiple (array $targets, array $options=[]) | |||||||
duplicateAllAssociatedEntries (LinkTarget $oldTarget, LinkTarget $newTarget) | |||||||
duplicateEntry (LinkTarget $oldTarget, LinkTarget $newTarget) | |||||||
enqueueWatchlistExpiryJob (float $watchlistPurgeRate) | |||||||
Probabilistically add a job to purge the expired watchlist items.
| |||||||
getLatestNotificationTimestamp ( $timestamp, UserIdentity $user, LinkTarget $target) | |||||||
Convert $timestamp to TS_MW or return null if the page was visited since then by $user. | |||||||
getMaxId () | |||||||
getNotificationTimestampsBatch (UserIdentity $user, array $targets) | |||||||
getWatchedItem (UserIdentity $user, LinkTarget $target) | |||||||
getWatchedItemsForUser (UserIdentity $user, array $options=[]) | |||||||
isTempWatched (UserIdentity $user, LinkTarget $target) | |||||||
Check if the user is temporarily watching the page. | |||||||
isWatched (UserIdentity $user, LinkTarget $target) | |||||||
loadWatchedItem (UserIdentity $user, LinkTarget $target) | |||||||
mustClearWatchedItemsUsingJobQueue (UserIdentity $user) | |||||||
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems() | |||||||
overrideDeferredUpdatesAddCallableUpdateCallback (callable $callback) | |||||||
Overrides the DeferredUpdates::addCallableUpdate callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined. | |||||||
removeExpired (int $limit, bool $deleteOrphans=false) | |||||||
Remove some number of expired watchlist items.
| |||||||
removeWatch (UserIdentity $user, LinkTarget $target) | |||||||
removeWatchBatchForUser (UserIdentity $user, array $titles) | |||||||
resetAllNotificationTimestampsForUser (UserIdentity $user, $timestamp=null) | |||||||
Schedule a DeferredUpdate that sets all of the "last viewed" timestamps for a given user to the same value. | |||||||
resetNotificationTimestamp (UserIdentity $user, LinkTarget $title, $force='', $oldid=0) | |||||||
setNotificationTimestampsForUser (UserIdentity $user, $timestamp, array $targets=[]) | |||||||
Set the "last viewed" timestamps for certain titles on a user's watchlist. | |||||||
setStatsdDataFactory (StatsdDataFactoryInterface $stats) | |||||||
updateNotificationTimestamp (UserIdentity $editor, LinkTarget $target, $timestamp) | |||||||
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Public Attributes inherited from WatchedItemStoreInterface | |
const | SORT_ASC = 'ASC' |
const | SORT_DESC = 'DESC' |
Private Member Functions | |
cache (WatchedItem $item) | |
fetchWatchedItems (IDatabase $db, UserIdentity $user, array $vars, array $options=[], ?LinkTarget $target=null) | |
Fetches either a single or all watched items for the given user. | |
fetchWatchedItemsForPage (IDatabase $dbw, LinkTarget $target) | |
getCached (UserIdentity $user, LinkTarget $target) | |
getCacheKey (UserIdentity $user, LinkTarget $target) | |
getConnectionRef ( $dbIndex) | |
getNotificationTimestamp (UserIdentity $user, LinkTarget $title, $item, $force, $oldid) | |
getPageSeenKey (LinkTarget $target) | |
getPageSeenTimestamps (UserIdentity $user) | |
getPageSeenTimestampsKey (UserIdentity $user) | |
getTitleDbKeysGroupedByNamespace (array $titles) | |
getVisitingWatchersCondition (IDatabase $db, array $targetsWithVisitThresholds) | |
Generates condition for the query used in a batch count visiting watchers. | |
getWatchedItemFromRow (UserIdentity $user, LinkTarget $target, stdClass $row) | |
Construct a new WatchedItem given a row from watchlist/watchlist_expiry. | |
uncache (UserIdentity $user, LinkTarget $target) | |
uncacheAllItemsForUser (UserIdentity $user) | |
uncacheLinkTarget (LinkTarget $target) | |
uncacheTitlesForUser (UserIdentity $user, array $titles) | |
uncacheUser (UserIdentity $user) | |
updateExpiries (IDatabase $dbw, string $expiry, string $cond) | |
Update the expiries for items found with the given $cond. | |
updateExpiriesAfterMove (IDatabase $dbw, array $expiries, int $namespace, string $dbKey) | |
updateOrDeleteExpiries (IDatabase $dbw, int $userId, array $rows, ?string $expiry=null) | |
Insert/update expiries, or delete them if the expiry is 'infinity'. | |
Private Attributes | |
HashBagOStuff | $cache |
array[][] | $cacheIndex = [] |
Looks like $cacheIndex[Namespace ID][Target DB Key][User Id] => 'key' The index is needed so that on mass changes all relevant items can be un-cached. | |
callable null | $deferredUpdatesAddCallableUpdateCallback |
bool | $expiryEnabled |
Correlates to $wgWatchlistExpiry feature flag. | |
HookRunner | $hookRunner |
HashBagOStuff | $latestUpdateCache |
ILBFactory | $lbFactory |
LoadBalancer | $loadBalancer |
string null | $maxExpiryDuration |
Maximum configured relative expiry. | |
NamespaceInfo | $nsInfo |
JobQueueGroup | $queueGroup |
ReadOnlyMode | $readOnlyMode |
RevisionLookup | $revisionLookup |
BagOStuff | $stash |
StatsdDataFactoryInterface | $stats |
int | $updateRowsPerQuery |
Storage layer class for WatchedItems.
Database interaction & caching TODO caching should be factored out into a CachingWatchedItemStore class
Definition at line 26 of file WatchedItemStore.php.
WatchedItemStore::__construct | ( | ServiceOptions | $options, |
ILBFactory | $lbFactory, | ||
JobQueueGroup | $queueGroup, | ||
BagOStuff | $stash, | ||
HashBagOStuff | $cache, | ||
ReadOnlyMode | $readOnlyMode, | ||
NamespaceInfo | $nsInfo, | ||
RevisionLookup | $revisionLookup, | ||
HookContainer | $hookContainer | ||
) |
ServiceOptions | $options | |
ILBFactory | $lbFactory | |
JobQueueGroup | $queueGroup | |
BagOStuff | $stash | |
HashBagOStuff | $cache | |
ReadOnlyMode | $readOnlyMode | |
NamespaceInfo | $nsInfo | |
RevisionLookup | $revisionLookup | |
HookContainer | $hookContainer |
Definition at line 132 of file WatchedItemStore.php.
References $cache, $lbFactory, $nsInfo, $queueGroup, $readOnlyMode, $revisionLookup, $stash, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), cache(), MediaWiki\Config\ServiceOptions\get(), and Wikimedia\Rdbms\ILBFactory\getMainLB().
WatchedItemStore::addWatch | ( | UserIdentity | $user, |
LinkTarget | $target, | ||
?string | $expiry = null |
||
) |
UserIdentity | $user | |
LinkTarget | $target | |
string | null | $expiry | Optional expiry in any format acceptable to wfTimestamp(). null will not create an expiry, or leave it unchanged should one already exist. |
Implements WatchedItemStoreInterface.
Definition at line 948 of file WatchedItemStore.php.
WatchedItemStore::addWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets, | ||
?string | $expiry = null |
||
) |
Add multiple items to the user's watchlist.
If you know you're adding a single page (and/or its talk page) use self::addWatch(), since it will add the WatchedItem to the process cache.
UserIdentity | $user | |
LinkTarget[] | $targets | |
string | null | $expiry | Optional expiry in a format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Implements WatchedItemStoreInterface.
Definition at line 984 of file WatchedItemStore.php.
References DB_MASTER, MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
|
private |
Definition at line 203 of file WatchedItemStore.php.
References cache(), getCacheKey(), WatchedItem\getLinkTarget(), and WatchedItem\getUserIdentity().
Referenced by __construct(), cache(), getCached(), getCacheKey(), uncache(), uncacheLinkTarget(), and uncacheUser().
WatchedItemStore::clearUserWatchedItems | ( | UserIdentity | $user | ) |
Deletes ALL watched items for the given user when under $updateRowsPerQuery entries exist.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 274 of file WatchedItemStore.php.
References DB_MASTER, MediaWiki\User\UserIdentity\getId(), mustClearWatchedItemsUsingJobQueue(), and uncacheAllItemsForUser().
WatchedItemStore::clearUserWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Queues a job that will clear the users watchlist using the Job Queue.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 351 of file WatchedItemStore.php.
References $job, and ClearUserWatchlistJob\newForUser().
WatchedItemStore::countExpired | ( | ) |
Get the number of watchlist items that expire before the current time.
Implements WatchedItemStoreInterface.
Definition at line 1718 of file WatchedItemStore.php.
WatchedItemStore::countUnreadNotifications | ( | UserIdentity | $user, |
$unreadLimit = null |
|||
) |
UserIdentity | $user | |
int | null | $unreadLimit |
Implements WatchedItemStoreInterface.
Definition at line 1518 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, and MediaWiki\User\UserIdentity\getId().
WatchedItemStore::countVisitingWatchers | ( | LinkTarget | $target, |
$threshold | |||
) |
LinkTarget | $target | |
string | int | $threshold |
Implements WatchedItemStoreInterface.
Definition at line 448 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, MediaWiki\Linker\LinkTarget\getDBkey(), and MediaWiki\Linker\LinkTarget\getNamespace().
WatchedItemStore::countVisitingWatchersMultiple | ( | array | $targetsWithVisitThresholds, |
$minimumWatchers = null |
|||
) |
array | $targetsWithVisitThresholds | |
int | null | $minimumWatchers |
Implements WatchedItemStoreInterface.
Definition at line 595 of file WatchedItemStore.php.
References $dbr, $res, and DB_REPLICA.
WatchedItemStore::countWatchedItems | ( | UserIdentity | $user | ) |
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 386 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, and MediaWiki\User\UserIdentity\getId().
WatchedItemStore::countWatchers | ( | LinkTarget | $target | ) |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 415 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, MediaWiki\Linker\LinkTarget\getDBkey(), and MediaWiki\Linker\LinkTarget\getNamespace().
WatchedItemStore::countWatchersMultiple | ( | array | $targets, |
array | $options = [] |
||
) |
LinkTarget[] | $targets | |
array | $options |
Implements WatchedItemStoreInterface.
Definition at line 547 of file WatchedItemStore.php.
References $dbr, $res, and DB_REPLICA.
WatchedItemStore::duplicateAllAssociatedEntries | ( | LinkTarget | $oldTarget, |
LinkTarget | $newTarget | ||
) |
LinkTarget | $oldTarget | |
LinkTarget | $newTarget |
Implements WatchedItemStoreInterface.
Definition at line 1550 of file WatchedItemStore.php.
WatchedItemStore::duplicateEntry | ( | LinkTarget | $oldTarget, |
LinkTarget | $newTarget | ||
) |
LinkTarget | $oldTarget | |
LinkTarget | $newTarget |
Implements WatchedItemStoreInterface.
Definition at line 1567 of file WatchedItemStore.php.
References DB_MASTER, MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\Linker\LinkTarget\getNamespace(), and Wikimedia\Rdbms\IDatabase\replace().
WatchedItemStore::enqueueWatchlistExpiryJob | ( | float | $watchlistPurgeRate | ) |
Probabilistically add a job to purge the expired watchlist items.
float | $watchlistPurgeRate | The value of the $wgWatchlistPurgeRate configuration variable. |
Implements WatchedItemStoreInterface.
Definition at line 359 of file WatchedItemStore.php.
|
private |
Fetches either a single or all watched items for the given user.
If a $target is given, IDatabase::selectRow() is called, otherwise select(). If $wgWatchlistExpiry is enabled, expired items are not returned.
IDatabase | $db | |
UserIdentity | $user | |
array | $vars | we_expiry is added when $wgWatchlistExpiry is enabled. |
array | $options | |
LinkTarget | null | $target | null if selecting all watched items. |
Definition at line 823 of file WatchedItemStore.php.
References Wikimedia\Rdbms\IDatabase\addQuotes(), MediaWiki\User\UserIdentity\getId(), and Wikimedia\Rdbms\IDatabase\timestamp().
|
private |
IDatabase | $dbw | |
LinkTarget | $target |
Definition at line 1613 of file WatchedItemStore.php.
|
private |
UserIdentity | $user | |
LinkTarget | $target |
Definition at line 251 of file WatchedItemStore.php.
References cache(), and getCacheKey().
|
private |
Definition at line 195 of file WatchedItemStore.php.
References cache(), MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\User\UserIdentity\getId(), and MediaWiki\Linker\LinkTarget\getNamespace().
Referenced by cache(), getCached(), and uncache().
|
private |
int | $dbIndex | DB_MASTER or DB_REPLICA |
Definition at line 260 of file WatchedItemStore.php.
WatchedItemStore::getLatestNotificationTimestamp | ( | $timestamp, | |
UserIdentity | $user, | ||
LinkTarget | $target | ||
) |
Convert $timestamp to TS_MW or return null if the page was visited since then by $user.
Use this only on single-user methods (having higher read-after-write expectations) and not in places involving arbitrary batches of different users
Usage of this method should be limited to WatchedItem* classes
string | null | $timestamp | Value of wl_notificationtimestamp from the DB |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 1198 of file WatchedItemStore.php.
References wfTimestampOrNull().
WatchedItemStore::getMaxId | ( | ) |
Definition at line 371 of file WatchedItemStore.php.
References $dbr, and DB_REPLICA.
|
private |
UserIdentity | $user | |
LinkTarget | $title | |
WatchedItem | $item | |
bool | $force | |
int | bool | $oldid | The ID of the last revision that the user viewed |
Definition at line 1459 of file WatchedItemStore.php.
References $title.
WatchedItemStore::getNotificationTimestampsBatch | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | $targets |
Implements WatchedItemStoreInterface.
Definition at line 892 of file WatchedItemStore.php.
References $dbr, $res, DB_REPLICA, MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
|
private |
|
private |
UserIdentity | $user |
Definition at line 1419 of file WatchedItemStore.php.
|
private |
UserIdentity | $user |
Definition at line 1435 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId().
Referenced by uncacheUser().
|
private |
LinkTarget[] | $titles |
Definition at line 1696 of file WatchedItemStore.php.
References $title.
|
private |
Generates condition for the query used in a batch count visiting watchers.
IDatabase | $db | |
array | $targetsWithVisitThresholds | array of pairs (LinkTarget, last visit threshold) |
Definition at line 651 of file WatchedItemStore.php.
References Wikimedia\Rdbms\IDatabase\addQuotes(), LIST_AND, LIST_OR, Wikimedia\Rdbms\IDatabase\makeList(), and Wikimedia\Rdbms\IDatabase\timestamp().
WatchedItemStore::getWatchedItem | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 694 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\isRegistered().
|
private |
Construct a new WatchedItem given a row from watchlist/watchlist_expiry.
UserIdentity | $user | |
LinkTarget | $target | |
stdClass | $row |
Definition at line 797 of file WatchedItemStore.php.
WatchedItemStore::getWatchedItemsForUser | ( | UserIdentity | $user, |
array | $options = [] |
||
) |
UserIdentity | $user | |
array | $options |
Implements WatchedItemStoreInterface.
Definition at line 746 of file WatchedItemStore.php.
References $res, DB_MASTER, and DB_REPLICA.
WatchedItemStore::isTempWatched | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Check if the user is temporarily watching the page.
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 881 of file WatchedItemStore.php.
WatchedItemStore::isWatched | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 870 of file WatchedItemStore.php.
WatchedItemStore::loadWatchedItem | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 714 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, and MediaWiki\User\UserIdentity\isRegistered().
WatchedItemStore::mustClearWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems()
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 316 of file WatchedItemStore.php.
Referenced by clearUserWatchedItems().
WatchedItemStore::overrideDeferredUpdatesAddCallableUpdateCallback | ( | callable | $callback | ) |
Overrides the DeferredUpdates::addCallableUpdate callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
callable | $callback |
MWException |
Definition at line 182 of file WatchedItemStore.php.
References $deferredUpdatesAddCallableUpdateCallback.
WatchedItemStore::removeExpired | ( | int | $limit, |
bool | $deleteOrphans = false |
||
) |
Remove some number of expired watchlist items.
int | $limit | The number of items to remove. |
bool | $deleteOrphans | Whether to also delete watchlist_expiry rows that have no related watchlist rows (because not all code knows about the expiry table yet). This runs two extra queries, so is only done from the purgeExpiredWatchlistItems.php maintenance script. |
Implements WatchedItemStoreInterface.
Definition at line 1731 of file WatchedItemStore.php.
WatchedItemStore::removeWatch | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 1126 of file WatchedItemStore.php.
WatchedItemStore::removeWatchBatchForUser | ( | UserIdentity | $user, |
array | $titles | ||
) |
UserIdentity | $user | |
LinkTarget[] | $titles |
Implements WatchedItemStoreInterface.
Definition at line 483 of file WatchedItemStore.php.
References DB_MASTER, MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
WatchedItemStore::resetAllNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp = null |
|||
) |
Schedule a DeferredUpdate that sets all of the "last viewed" timestamps for a given user to the same value.
UserIdentity | $user | |
string | int | null | $timestamp | Value to set all timestamps to, null to clear them |
Implements WatchedItemStoreInterface.
Definition at line 1224 of file WatchedItemStore.php.
References $job, MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
WatchedItemStore::resetNotificationTimestamp | ( | UserIdentity | $user, |
LinkTarget | $title, | ||
$force = '' , |
|||
$oldid = 0 |
|||
) |
UserIdentity | $user | |
LinkTarget | $title | |
string | $force | |
int | $oldid |
Implements WatchedItemStoreInterface.
Definition at line 1325 of file WatchedItemStore.php.
References $cache, $job, $title, MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\isRegistered(), User\newFromId(), and wfTimestamp().
WatchedItemStore::setNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp, | |||
array | $targets = [] |
||
) |
Set the "last viewed" timestamps for certain titles on a user's watchlist.
If the $targets parameter is omitted or set to [], this method simply wraps resetAllNotificationTimestampsForUser(), and in that case you should instead call that method directly; support for omitting $targets is for backwards compatibility.
If $targets is omitted or set to [], timestamps will be updated for every title on the user's watchlist, and this will be done through a DeferredUpdate. If $targets is a non-empty array, only the specified titles will be updated, and this will be done immediately (not deferred).
UserIdentity | $user | |
string | int | $timestamp | Value to set the "last viewed" timestamp to (null to clear) |
LinkTarget[] | $targets | Titles to set the timestamp for; [] means the entire watchlist |
Implements WatchedItemStoreInterface.
Definition at line 1147 of file WatchedItemStore.php.
References Wikimedia\Rdbms\IDatabase\affectedRows(), DB_MASTER, MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\isRegistered(), Wikimedia\Rdbms\IDatabase\timestamp(), and Wikimedia\Rdbms\IDatabase\update().
WatchedItemStore::setStatsdDataFactory | ( | StatsdDataFactoryInterface | $stats | ) |
StatsdDataFactoryInterface | $stats |
Implements StatsdAwareInterface.
Definition at line 167 of file WatchedItemStore.php.
References $stats.
|
private |
Definition at line 212 of file WatchedItemStore.php.
References cache(), getCacheKey(), MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\User\UserIdentity\getId(), and MediaWiki\Linker\LinkTarget\getNamespace().
|
private |
Definition at line 320 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId().
Referenced by clearUserWatchedItems().
|
private |
Definition at line 218 of file WatchedItemStore.php.
References cache(), MediaWiki\Linker\LinkTarget\getDBkey(), and MediaWiki\Linker\LinkTarget\getNamespace().
|
private |
UserIdentity | $user | |
LinkTarget[] | $titles |
Definition at line 1709 of file WatchedItemStore.php.
References $title.
|
private |
Definition at line 229 of file WatchedItemStore.php.
References cache(), MediaWiki\User\UserIdentity\getId(), and getPageSeenTimestampsKey().
|
private |
Update the expiries for items found with the given $cond.
IDatabase | $dbw | |
string | $expiry | |
string | $cond |
Definition at line 1093 of file WatchedItemStore.php.
|
private |
IDatabase | $dbw | |
array | $expiries | |
int | $namespace | |
string | $dbKey |
Definition at line 1646 of file WatchedItemStore.php.
References $res, Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\select().
WatchedItemStore::updateNotificationTimestamp | ( | UserIdentity | $editor, |
LinkTarget | $target, | ||
$timestamp | |||
) |
UserIdentity | $editor | |
LinkTarget | $target | |
string | int | $timestamp |
Implements WatchedItemStoreInterface.
Definition at line 1252 of file WatchedItemStore.php.
References Wikimedia\Rdbms\IDatabase\addQuotes(), DB_MASTER, MediaWiki\Linker\LinkTarget\getDBkey(), Wikimedia\Rdbms\IDatabase\getDomainID(), MediaWiki\User\UserIdentity\getId(), MediaWiki\Linker\LinkTarget\getNamespace(), Wikimedia\Rdbms\IDatabase\selectFieldValues(), Wikimedia\Rdbms\IDatabase\timestamp(), and Wikimedia\Rdbms\IDatabase\update().
|
private |
Insert/update expiries, or delete them if the expiry is 'infinity'.
IDatabase | $dbw | |
int | $userId | |
array | $rows | |
string | null | $expiry |
Definition at line 1044 of file WatchedItemStore.php.
|
private |
Definition at line 65 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Looks like $cacheIndex[Namespace ID][Target DB Key][User Id] => 'key' The index is needed so that on mass changes all relevant items can be un-cached.
For example: Clearing a users watchlist of all items or updating notification timestamps for all users watching a single target. -var array<int,array<string,array<int,string>>>
Definition at line 79 of file WatchedItemStore.php.
|
private |
Definition at line 84 of file WatchedItemStore.php.
Referenced by overrideDeferredUpdatesAddCallableUpdateCallback().
|
private |
Correlates to $wgWatchlistExpiry feature flag.
Definition at line 109 of file WatchedItemStore.php.
|
private |
Definition at line 114 of file WatchedItemStore.php.
|
private |
Definition at line 70 of file WatchedItemStore.php.
|
private |
Definition at line 40 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 45 of file WatchedItemStore.php.
|
private |
Maximum configured relative expiry.
Definition at line 119 of file WatchedItemStore.php.
|
private |
Definition at line 94 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 50 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 60 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 99 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 55 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 104 of file WatchedItemStore.php.
Referenced by setStatsdDataFactory().
|
private |
Definition at line 89 of file WatchedItemStore.php.
const WatchedItemStore::CONSTRUCTOR_OPTIONS |
Definition at line 31 of file WatchedItemStore.php.