summaryrefslogtreecommitdiff
path: root/inc/cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/cache.php')
-rw-r--r--inc/cache.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/cache.php b/inc/cache.php
index 3546e031..cc0624e4 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -9,6 +9,9 @@
self::$cache = new Memcached();
self::$cache->addServers($config['cache']['memcached']);
break;
+ case 'php':
+ self::$cache = Array();
+ break;
}
}
public static function get($key) {
@@ -27,6 +30,9 @@
case 'xcache':
$data = xcache_get($key);
break;
+ case 'php':
+ $data = isset(self::$cache[$key]) ? self::$cache[$key] : false;
+ break;
}
// debug
@@ -54,6 +60,9 @@
case 'xcache':
xcache_set($key, $value, $expires);
break;
+ case 'php':
+ self::$cache[$key] = $value;
+ break;
}
}
public static function delete($key) {
@@ -71,6 +80,9 @@
case 'xcache':
xcache_unset($key);
break;
+ case 'php':
+ unset(self::$cache[$key]);
+ break;
}
}
public static function flush() {
@@ -83,6 +95,9 @@
return self::$cache->flush();
case 'apc':
return apc_clear_cache('user');
+ case 'php':
+ self::$cache[$key] = Array();
+ break;
}
return false;