1 | <?php |
||
42 | class ApcCache extends SimpleCache |
||
43 | { |
||
44 | /** |
||
45 | * Initializes this application component. |
||
46 | * It checks if extension required is loaded. |
||
47 | * @throws \yii\base\InvalidConfigException |
||
48 | */ |
||
49 | 16 | public function init() |
|
50 | { |
||
51 | 16 | parent::init(); |
|
52 | 16 | if (!extension_loaded('apcu')) { |
|
53 | throw new InvalidConfigException('ApcCache requires PHP apcu extension to be loaded.'); |
||
54 | } |
||
55 | 16 | } |
|
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | 2 | public function has($key) |
|
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | 13 | protected function getValue($key) |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | 3 | protected function getValues($keys) |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 12 | protected function setValue($key, $value, $ttl) |
|
86 | { |
||
87 | 12 | return apcu_store($key, $value, $ttl); |
|
88 | } |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | 4 | protected function setValues($values, $ttl) |
|
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | 1 | protected function deleteValue($key) |
|
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | 11 | public function clear() |
|
114 | } |
||
115 |