| 1 | <?php |
||
| 9 | class MemcacheStorage implements CacheStorageInterface |
||
| 10 | { |
||
| 11 | private $mmc; |
||
| 12 | |||
| 13 | public function __construct(\Memcached $memcache, $server = 'localhost', $port = 11211) |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Add new server to Memcache pool. |
||
| 21 | * @param $server |
||
| 22 | * @param $port |
||
| 23 | */ |
||
| 24 | public function addServer($server, $port) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $key |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | public function has($key){ |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param int $delay |
||
| 42 | */ |
||
| 43 | public function flush($delay = 0) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $key |
||
| 50 | * @param mixed $value |
||
| 51 | * @param int $expires |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | public function set($key, $value, $expires) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param string $key |
||
| 61 | * @return mixed |
||
| 62 | */ |
||
| 63 | public function get($key) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $key |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | public function delete($key) |
||
| 76 | |||
| 77 | } |
||
| 78 |