1 | <?php |
||
32 | class MemcachedStorage extends AbstractStorage implements MemcachedStorageInterface |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * Array that contains servers the storage is bound to. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $servers = array(); |
||
41 | |||
42 | /** |
||
43 | * Adds an server to the internal list with servers this storage |
||
44 | * is bound to, used by MemcachedStorage for example. |
||
45 | * |
||
46 | * @param string $host The server host |
||
47 | * @param integer $port The server port |
||
48 | * @param integer $weight The weight the server has |
||
49 | * |
||
50 | * @return void |
||
51 | * @see \AppserverIo\Storage\StorageInterface::addServer() |
||
52 | */ |
||
53 | public function addServer($host, $port, $weight) |
||
57 | |||
58 | /** |
||
59 | * Returns the list with servers this storage is bound to. |
||
60 | * |
||
61 | * @return array The server list |
||
62 | * @see \AppserverIo\Storage\StorageInterface::getServers() |
||
63 | */ |
||
64 | public function getServers() |
||
68 | |||
69 | /** |
||
70 | * (non-PHPdoc) |
||
71 | * |
||
72 | * @return void |
||
73 | * @see AppserverIo\Storage\AbstractStorage::init(); |
||
74 | */ |
||
75 | public function init() |
||
89 | |||
90 | /** |
||
91 | * (non-PHPdoc) |
||
92 | * |
||
93 | * @param string $entryIdentifier Something which identifies the data - depends on concrete cache |
||
94 | * @param mixed $data The data to cache - also depends on the concrete cache implementation |
||
95 | * @param array $tags Tags to associate with this cache entry |
||
96 | * @param integer $lifetime Lifetime of this cache entry in seconds. If NULL is specified, |
||
97 | * the default lifetime is used. "0" means unlimited lifetime. |
||
98 | * |
||
99 | * @return void |
||
100 | * @see \AppserverIo\Storage\StorageInterface::set() |
||
101 | */ |
||
102 | public function set($entryIdentifier, $data, array $tags = array(), $lifetime = null) |
||
120 | |||
121 | /** |
||
122 | * (non-PHPdoc) |
||
123 | * |
||
124 | * @param string $entryIdentifier Something which identifies the cache entry - depends on concrete cache |
||
125 | * |
||
126 | * @return mixed |
||
127 | * @see \AppserverIo\Storage\StorageInterface::get() |
||
128 | */ |
||
129 | public function get($entryIdentifier) |
||
133 | |||
134 | /** |
||
135 | * (non-PHPdoc) |
||
136 | * |
||
137 | * @param string $entryIdentifier An identifier specifying the cache entry |
||
138 | * |
||
139 | * @return boolean TRUE if such an entry exists, FALSE if not |
||
140 | * @see \AppserverIo\Storage\StorageInterface::remove() |
||
141 | */ |
||
142 | public function remove($entryIdentifier) |
||
146 | |||
147 | /** |
||
148 | * (non-PHPdoc) |
||
149 | * |
||
150 | * @return array |
||
151 | * @see \AppserverIo\Storage\StorageInterface::getAllKeys() |
||
152 | */ |
||
153 | public function getAllKeys() |
||
157 | } |
||
158 |