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 protected function doIncrWithInit( $key, $exptime, $step, $init, $flags ) {
55 // faster
56 return $init;
57 }
58
59 public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
60 // faster
61 return true;
62 }
63}
array $params
The job parameters.
A BagOStuff object with no objects in it.
doIncrWithInit( $key, $exptime, $step, $init, $flags)
doGet( $key, $flags=0, &$casToken=null)
Get an item.
doSet( $key, $value, $exptime=0, $flags=0)
Set an item.
doDelete( $key, $flags=0)
Delete an item.
__construct(array $params=[])
merge( $key, callable $callback, $exptime=0, $attempts=10, $flags=0)
Merge changes into the existing cache value (possibly creating a new one)
doAdd( $key, $value, $exptime=0, $flags=0)
Insert an item if it does not already exist.
Storage medium specific cache for storing items (e.g.