1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice.
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11: * @link https://cakephp.org CakePHP(tm) Project
12: * @since 3.0.0
13: * @license https://opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cake\Cache\Engine;
16:
17: use Cake\Cache\CacheEngine;
18:
19: /**
20: * Null cache engine, all operations appear to work, but do nothing.
21: *
22: * This is used internally for when Cache::disable() has been called.
23: */
24: class NullEngine extends CacheEngine
25: {
26:
27: /**
28: * {@inheritDoc}
29: */
30: public function init(array $config = [])
31: {
32: return true;
33: }
34:
35: /**
36: * {@inheritDoc}
37: */
38: public function gc($expires = null)
39: {
40: }
41:
42: /**
43: * {@inheritDoc}
44: */
45: public function write($key, $value)
46: {
47: return true;
48: }
49:
50: /**
51: * {@inheritDoc}
52: */
53: public function read($key)
54: {
55: return false;
56: }
57:
58: /**
59: * {@inheritDoc}
60: */
61: public function readMany($keys)
62: {
63: return [];
64: }
65:
66: /**
67: * {@inheritDoc}
68: */
69: public function increment($key, $offset = 1)
70: {
71: return true;
72: }
73:
74: /**
75: * {@inheritDoc}
76: */
77: public function decrement($key, $offset = 1)
78: {
79: return true;
80: }
81:
82: /**
83: * {@inheritDoc}
84: */
85: public function delete($key)
86: {
87: return true;
88: }
89:
90: /**
91: * {@inheritDoc}
92: */
93: public function deleteMany($keys)
94: {
95: return [];
96: }
97:
98: /**
99: * {@inheritDoc}
100: */
101: public function clear($check)
102: {
103: return false;
104: }
105:
106: /**
107: * {@inheritDoc}
108: */
109: public function clearGroup($group)
110: {
111: return false;
112: }
113: }
114: