comparison core/lib/Drupal/Core/Cache/NullBackend.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Cache;
4
5 /**
6 * Defines a stub cache implementation.
7 *
8 * The stub implementation is needed when database access is not yet available.
9 * Because Drupal's caching system never requires that cached data be present,
10 * these stub functions can short-circuit the process and sidestep the need for
11 * any persistent storage. Using this cache implementation during normal
12 * operations would have a negative impact on performance.
13 *
14 * This also can be used for testing purposes.
15 *
16 * @ingroup cache
17 */
18 class NullBackend implements CacheBackendInterface {
19
20 /**
21 * Constructs a NullBackend object.
22 *
23 * @param string $bin
24 * The cache bin for which the object is created.
25 */
26 public function __construct($bin) {}
27
28 /**
29 * {@inheritdoc}
30 */
31 public function get($cid, $allow_invalid = FALSE) {
32 return FALSE;
33 }
34
35 /**
36 * {@inheritdoc}
37 */
38 public function getMultiple(&$cids, $allow_invalid = FALSE) {
39 return [];
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {}
46
47 /**
48 * {@inheritdoc}
49 */
50 public function setMultiple(array $items = []) {}
51
52 /**
53 * {@inheritdoc}
54 */
55 public function delete($cid) {}
56
57 /**
58 * {@inheritdoc}
59 */
60 public function deleteMultiple(array $cids) {}
61
62 /**
63 * {@inheritdoc}
64 */
65 public function deleteAll() {}
66
67 /**
68 * {@inheritdoc}
69 */
70 public function invalidate($cid) {}
71
72 /**
73 * {@inheritdoc}
74 */
75 public function invalidateMultiple(array $cids) {}
76
77 /**
78 * {@inheritdoc}
79 */
80 public function invalidateAll() {}
81
82 /**
83 * {@inheritdoc}
84 */
85 public function garbageCollection() {}
86
87 /**
88 * {@inheritdoc}
89 */
90 public function removeBin() {}
91
92 }