1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Part of the Joomla Framework Cache Package |
4
|
|
|
* |
5
|
|
|
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. |
6
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Joomla\Cache; |
10
|
|
|
|
11
|
|
|
use Psr\Cache\CacheItemInterface; |
12
|
|
|
use Joomla\Cache\Item\Item; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Runtime cache only driver for the Joomla Framework. |
16
|
|
|
* |
17
|
|
|
* @since 1.0 |
18
|
|
|
*/ |
19
|
|
|
class None extends Cache |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* This will wipe out the entire cache's keys |
23
|
|
|
* |
24
|
|
|
* @return boolean The result of the clear operation. |
25
|
|
|
* |
26
|
|
|
* @since 1.0 |
27
|
|
|
*/ |
28
|
1 |
|
public function clear() |
29
|
|
|
{ |
30
|
1 |
|
return true; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Method to get a storage entry value from a key. |
35
|
|
|
* |
36
|
|
|
* @param string $key The storage entry identifier. |
37
|
|
|
* |
38
|
|
|
* @return CacheItemInterface |
39
|
|
|
* |
40
|
|
|
* @since 1.0 |
41
|
|
|
*/ |
42
|
1 |
|
public function getItem($key) |
43
|
|
|
{ |
44
|
1 |
|
return new Item($key); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Method to remove a storage entry for a key. |
49
|
|
|
* |
50
|
|
|
* @param string $key The storage entry identifier. |
51
|
|
|
* |
52
|
|
|
* @return boolean |
53
|
|
|
* |
54
|
|
|
* @since 1.0 |
55
|
|
|
*/ |
56
|
1 |
|
public function deleteItem($key) |
57
|
|
|
{ |
58
|
1 |
|
return true; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Persists a cache item immediately. |
63
|
|
|
* |
64
|
|
|
* @param CacheItemInterface $item The cache item to save. |
65
|
|
|
* |
66
|
|
|
* @return static The invoked object. |
67
|
|
|
*/ |
68
|
1 |
|
public function save(CacheItemInterface $item) |
69
|
|
|
{ |
70
|
1 |
|
return true; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Method to determine whether a storage entry has been set for a key. |
75
|
|
|
* |
76
|
|
|
* @param string $key The storage entry identifier. |
77
|
|
|
* |
78
|
|
|
* @return boolean |
79
|
|
|
* |
80
|
|
|
* @since 1.0 |
81
|
|
|
*/ |
82
|
1 |
|
public function hasItem($key) |
83
|
|
|
{ |
84
|
1 |
|
return false; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Test to see if the CacheItemPoolInterface is available |
89
|
|
|
* |
90
|
|
|
* @return boolean True on success, false otherwise |
91
|
|
|
* |
92
|
|
|
* @since __DEPLOY_VERSION__ |
93
|
|
|
*/ |
94
|
|
|
public static function isSupported() |
95
|
|
|
{ |
96
|
|
|
return true; |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|