| 1 | <?php |
||
| 16 | class Memcache extends ExpiringKeyValue { |
||
| 17 | |||
| 18 | /** @var \Memcache */ |
||
| 19 | protected $memcache; |
||
| 20 | |||
| 21 | public function __construct($host = 'localhost', $port = 11211) { |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Save data by auto-expire key |
||
| 30 | * @param $key |
||
| 31 | * @param string $data |
||
| 32 | * @param int $expire |
||
| 33 | */ |
||
| 34 | protected function set($key, $data, $expire) { |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get data by key if not expired |
||
| 40 | * @param $key |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | protected function get($key) { |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Remove key in store |
||
| 49 | * @param $key |
||
| 50 | * @return mixed |
||
| 51 | */ |
||
| 52 | protected function delete($key) { |
||
| 55 | } |
||
| 56 |