MediaWiki  master
EmptyBagOStuff.php
Go to the documentation of this file.
1 <?php
30  public function __construct( array $params = [] ) {
31  parent::__construct( $params );
32 
33  $this->attrMap[self::ATTR_DURABILITY] = self::QOS_DURABILITY_NONE;
34  }
35 
36  protected function doGet( $key, $flags = 0, &$casToken = null ) {
37  $casToken = null;
38 
39  return false;
40  }
41 
42  protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
43  return true;
44  }
45 
46  protected function doDelete( $key, $flags = 0 ) {
47  return true;
48  }
49 
50  protected function doAdd( $key, $value, $exptime = 0, $flags = 0 ) {
51  return true;
52  }
53 
54  public function incr( $key, $value = 1, $flags = 0 ) {
55  return false;
56  }
57 
58  public function decr( $key, $value = 1, $flags = 0 ) {
59  return false;
60  }
61 
62  public function incrWithInit( $key, $exptime, $value = 1, $init = null, $flags = 0 ) {
63  return false; // faster
64  }
65 
66  public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
67  return true; // faster
68  }
69 }
EmptyBagOStuff\doDelete
doDelete( $key, $flags=0)
Delete an item.
Definition: EmptyBagOStuff.php:46
EmptyBagOStuff\merge
merge( $key, callable $callback, $exptime=0, $attempts=10, $flags=0)
Merge changes into the existing cache value (possibly creating a new one)
Definition: EmptyBagOStuff.php:66
EmptyBagOStuff
A BagOStuff object with no objects in it.
Definition: EmptyBagOStuff.php:29
EmptyBagOStuff\doAdd
doAdd( $key, $value, $exptime=0, $flags=0)
Insert an item if it does not already exist.
Definition: EmptyBagOStuff.php:50
EmptyBagOStuff\__construct
__construct(array $params=[])
Definition: EmptyBagOStuff.php:30
MediumSpecificBagOStuff
Storage medium specific cache for storing items (e.g.
Definition: MediumSpecificBagOStuff.php:34
EmptyBagOStuff\doGet
doGet( $key, $flags=0, &$casToken=null)
Definition: EmptyBagOStuff.php:36
EmptyBagOStuff\decr
decr( $key, $value=1, $flags=0)
Decrease stored value of $key by $value while preserving its TTL.
Definition: EmptyBagOStuff.php:58
EmptyBagOStuff\incr
incr( $key, $value=1, $flags=0)
Increase stored value of $key by $value while preserving its TTL.
Definition: EmptyBagOStuff.php:54
EmptyBagOStuff\doSet
doSet( $key, $value, $exptime=0, $flags=0)
Set an item.
Definition: EmptyBagOStuff.php:42
EmptyBagOStuff\incrWithInit
incrWithInit( $key, $exptime, $value=1, $init=null, $flags=0)
Increase the value of the given key (no TTL change) if it exists or create it otherwise.
Definition: EmptyBagOStuff.php:62