|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
A dummy KeyCache used to exclude cache layer from problems |
|
|
5 |
|
|
|
6 |
This program is free software: you can redistribute it and/or modify |
|
|
7 |
it under the terms of the GNU General Public License as published by |
|
|
8 |
the Free Software Foundation, either version 3 of the License, or |
|
|
9 |
(at your option) any later version. |
|
|
10 |
|
|
|
11 |
This program is distributed in the hope that it will be useful, |
|
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
14 |
GNU General Public License for more details. |
|
|
15 |
|
|
|
16 |
You should have received a copy of the GNU General Public License |
|
|
17 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
18 |
|
|
|
19 |
*/ |
|
|
20 |
|
|
|
21 |
/** |
|
|
22 |
* A basic KeyCache backed by an array. |
|
|
23 |
* @package Swift |
|
|
24 |
* @subpackage KeyCache |
|
|
25 |
* @author Xavier De Cock <xdecock@gmail.com> |
|
|
26 |
*/ |
|
|
27 |
class Swift_KeyCache_DummyKeyCache implements Swift_KeyCache |
|
|
28 |
{ |
|
|
29 |
/** |
|
|
30 |
* Set a string into the cache under $itemKey for the namespace $nsKey. |
|
|
31 |
* @param string $nsKey |
|
|
32 |
* @param string $itemKey |
|
|
33 |
* @param string $string |
|
|
34 |
* @param int $mode |
|
|
35 |
* @see MODE_WRITE, MODE_APPEND |
|
|
36 |
*/ |
|
|
37 |
public function setString($nsKey, $itemKey, $string, $mode) |
|
|
38 |
{} |
|
|
39 |
|
|
|
40 |
/** |
|
|
41 |
* Set a ByteStream into the cache under $itemKey for the namespace $nsKey. |
|
|
42 |
* @param string $nsKey |
|
|
43 |
* @param string $itemKey |
|
|
44 |
* @param Swift_OutputByteStream $os |
|
|
45 |
* @param int $mode |
|
|
46 |
* @see MODE_WRITE, MODE_APPEND |
|
|
47 |
*/ |
|
|
48 |
public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, |
|
|
49 |
$mode) |
|
|
50 |
{} |
|
|
51 |
|
|
|
52 |
/** |
|
|
53 |
* Provides a ByteStream which when written to, writes data to $itemKey. |
|
|
54 |
* NOTE: The stream will always write in append mode. |
|
|
55 |
* @param string $nsKey |
|
|
56 |
* @param string $itemKey |
|
|
57 |
* @return Swift_InputByteStream |
|
|
58 |
*/ |
|
|
59 |
public function getInputByteStream($nsKey, $itemKey, |
|
|
60 |
Swift_InputByteStream $writeThrough = null) |
|
|
61 |
{ |
|
|
62 |
return false; |
|
|
63 |
} |
|
|
64 |
|
|
|
65 |
/** |
|
|
66 |
* Get data back out of the cache as a string. |
|
|
67 |
* @param string $nsKey |
|
|
68 |
* @param string $itemKey |
|
|
69 |
* @return string |
|
|
70 |
*/ |
|
|
71 |
public function getString($nsKey, $itemKey) |
|
|
72 |
{ |
|
|
73 |
return false; |
|
|
74 |
} |
|
|
75 |
|
|
|
76 |
/** |
|
|
77 |
* Get data back out of the cache as a ByteStream. |
|
|
78 |
* @param string $nsKey |
|
|
79 |
* @param string $itemKey |
|
|
80 |
* @param Swift_InputByteStream $is to write the data to |
|
|
81 |
*/ |
|
|
82 |
public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) |
|
|
83 |
{ |
|
|
84 |
return false; |
|
|
85 |
} |
|
|
86 |
|
|
|
87 |
/** |
|
|
88 |
* Check if the given $itemKey exists in the namespace $nsKey. |
|
|
89 |
* @param string $nsKey |
|
|
90 |
* @param string $itemKey |
|
|
91 |
* @return boolean |
|
|
92 |
*/ |
|
|
93 |
public function hasKey($nsKey, $itemKey) |
|
|
94 |
{ |
|
|
95 |
return false; |
|
|
96 |
} |
|
|
97 |
|
|
|
98 |
/** |
|
|
99 |
* Clear data for $itemKey in the namespace $nsKey if it exists. |
|
|
100 |
* @param string $nsKey |
|
|
101 |
* @param string $itemKey |
|
|
102 |
*/ |
|
|
103 |
public function clearKey($nsKey, $itemKey) |
|
|
104 |
{} |
|
|
105 |
|
|
|
106 |
/** |
|
|
107 |
* Clear all data in the namespace $nsKey if it exists. |
|
|
108 |
* @param string $nsKey |
|
|
109 |
*/ |
|
|
110 |
public function clearAll($nsKey) |
|
|
111 |
{} |
|
|
112 |
} |