MediaWiki master
EmptyBagOStuff.php
Go to the documentation of this file.
1<?php
7
18 public function __construct( array $params = [] ) {
19 parent::__construct( $params );
20
22 }
23
25 protected function doGet( $key, $flags = 0, &$casToken = null ) {
26 $casToken = null;
27
28 return false;
29 }
30
32 protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
33 return true;
34 }
35
37 protected function doDelete( $key, $flags = 0 ) {
38 return true;
39 }
40
42 protected function doAdd( $key, $value, $exptime = 0, $flags = 0 ) {
43 return true;
44 }
45
47 protected function doIncrWithInit( $key, $exptime, $step, $init, $flags ) {
48 // faster
49 return $init;
50 }
51
53 public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
54 // faster
55 return true;
56 }
57}
58
60class_alias( EmptyBagOStuff::class, 'EmptyBagOStuff' );
const ATTR_DURABILITY
Key in getQoS() for durability of storage writes.
const QOS_DURABILITY_NONE
Storage is disabled or never saves data, not even temporarily (EmptyBagOStuff).
No-op implementation that stores nothing.
doAdd( $key, $value, $exptime=0, $flags=0)
Insert an item if it does not already exist.bool Success
merge( $key, callable $callback, $exptime=0, $attempts=10, $flags=0)
Merge changes into the existing cache value (possibly creating a new one)The callback function return...
doDelete( $key, $flags=0)
Delete an item.bool True if the item was deleted or not found, false on failure
doGet( $key, $flags=0, &$casToken=null)
Get an item.The CAS token should be null if the key does not exist or the value is corruptmixed Retur...
doSet( $key, $value, $exptime=0, $flags=0)
Set an item.bool Success
doIncrWithInit( $key, $exptime, $step, $init, $flags)
int|bool New value or false on failure
Helper classs that implements most of BagOStuff for a backend.