修复 getMulti 方式获取缓存无效的问题

This commit is contained in:
Discuz! 2017-02-08 10:41:52 +08:00
parent 98f6cc3a74
commit ffba5153b1
2 changed files with 22 additions and 30 deletions

View File

@ -22,10 +22,6 @@ class memory_driver_apc
return apc_fetch($key); return apc_fetch($key);
} }
public function getMulti($keys) {
return apc_fetch($keys);
}
public function set($key, $value, $ttl = 0) { public function set($key, $value, $ttl = 0) {
return apc_store($key, $value, $ttl); return apc_store($key, $value, $ttl);
} }

View File

@ -7,41 +7,37 @@
* $Id: memory_driver_apc.php 27635 2012-02-08 06:38:31Z zhangguosheng $ * $Id: memory_driver_apc.php 27635 2012-02-08 06:38:31Z zhangguosheng $
*/ */
if (!defined('IN_DISCUZ')) { if (!defined('IN_DISCUZ')) {
exit('Access Denied'); exit('Access Denied');
} }
class memory_driver_apcu { class memory_driver_apcu {
public function init($config) { public function init($config) {
} }
public function get($key) { public function get($key) {
return apcu_fetch($key); return apcu_fetch($key);
} }
public function getMulti($keys) { public function set($key, $value, $ttl = 0) {
return apcu_fetch($key); return apcu_store($key, $value, $ttl);
} }
public function set($key, $value, $ttl = 0) { public function rm($key) {
return apcu_store($key, $value, $ttl); return apcu_delete($key);
} }
public function rm($key) { public function clear() {
return apcu_delete($key); return apcu_clear_cache('user');
} }
public function clear() { public function inc($key, $step = 1) {
return apcu_clear_cache('user'); return apcu_inc($key, $step) !== false ? apcu_fetch($key) : false;
} }
public function inc($key, $step = 1) { public function dec($key, $step = 1) {
return apcu_inc($key, $step) !== false ? apcu_fetch($key) : false; return apcu_dec($key, $step) !== false ? apcu_fetch($key) : false;
} }
public function dec($key, $step = 1) {
return apcu_dec($key, $step) !== false ? apcu_fetch($key) : false;
}
} }