MediaWiki REL1_37
|
Class allowing easy storage and retrieval of EditResults associated with revisions. More...
Public Member Functions | |
__construct (BagOStuff $mainObjectStash, ILoadBalancer $loadBalancer, ServiceOptions $options) | |
get (int $revisionId) | |
Get an EditResult for the given revision ID. | |
set (int $revisionId, EditResult $editResult) | |
Store the EditResult in the main object stash. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Member Functions | |
makeKey (int $revisionId) | |
Generates a cache key for the given revision ID. | |
Private Attributes | |
ILoadBalancer | $loadBalancer |
BagOStuff | $mainObjectStash |
ServiceOptions | $options |
const | CACHE_KEY_PREFIX = 'EditResult' |
Class allowing easy storage and retrieval of EditResults associated with revisions.
EditResults are stored in the main object stash and (depending on wiki's configuration) in revert change tags. This class stores the relevant data in the main stash. When asked to retrieve an EditResult for an edit and the requested key is not present in the main stash, the class will attempt to retrieve the EditResult from revert tags.
Definition at line 42 of file EditResultCache.php.
MediaWiki\Storage\EditResultCache::__construct | ( | BagOStuff | $mainObjectStash, |
ILoadBalancer | $loadBalancer, | ||
ServiceOptions | $options | ||
) |
BagOStuff | $mainObjectStash | Main object stash, see MediaWikiServices::getMainObjectStash() |
ILoadBalancer | $loadBalancer | |
ServiceOptions | $options |
Definition at line 65 of file EditResultCache.php.
References MediaWiki\Storage\EditResultCache\$loadBalancer, MediaWiki\Storage\EditResultCache\$mainObjectStash, MediaWiki\Storage\EditResultCache\$options, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Storage\EditResultCache::get | ( | int | $revisionId | ) |
Get an EditResult for the given revision ID.
Will first attempt to get the EditResult from the main stash. If this fails, it will try to retrieve the EditResult from revert change tags of this revision.
int | $revisionId |
Definition at line 104 of file EditResultCache.php.
References $dbr, and DB_REPLICA.
|
private |
Generates a cache key for the given revision ID.
int | $revisionId |
Definition at line 141 of file EditResultCache.php.
MediaWiki\Storage\EditResultCache::set | ( | int | $revisionId, |
EditResult | $editResult | ||
) |
Store the EditResult in the main object stash.
int | $revisionId | |
EditResult | $editResult |
Definition at line 85 of file EditResultCache.php.
|
private |
Definition at line 54 of file EditResultCache.php.
Referenced by MediaWiki\Storage\EditResultCache\__construct().
|
private |
Definition at line 51 of file EditResultCache.php.
Referenced by MediaWiki\Storage\EditResultCache\__construct().
|
private |
Definition at line 57 of file EditResultCache.php.
Referenced by MediaWiki\Storage\EditResultCache\__construct().
|
private |
Definition at line 48 of file EditResultCache.php.
const MediaWiki\Storage\EditResultCache::CONSTRUCTOR_OPTIONS |
Definition at line 44 of file EditResultCache.php.