From fd626022ec02ef47b9142bba08180502babbd0ca Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jul 2012 22:23:08 -0700 Subject: add smarty engine, remove some obsolete zot1 stuff --- library/Smarty/demo/plugins/cacheresource.apc.php | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 library/Smarty/demo/plugins/cacheresource.apc.php (limited to 'library/Smarty/demo/plugins/cacheresource.apc.php') diff --git a/library/Smarty/demo/plugins/cacheresource.apc.php b/library/Smarty/demo/plugins/cacheresource.apc.php new file mode 100644 index 000000000..00ba59817 --- /dev/null +++ b/library/Smarty/demo/plugins/cacheresource.apc.php @@ -0,0 +1,77 @@ + $v) { + $_res[$k] = $v; + } + return $_res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire=null) + { + foreach ($keys as $k => $v) { + apc_store($k, $v, $expire); + } + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + apc_delete($k); + } + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return apc_clear_cache('user'); + } +} -- cgit v1.2.3