diff options
Diffstat (limited to 'phpBB/includes/acm')
-rw-r--r-- | phpBB/includes/acm/acm_apc.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_eaccelerator.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_memcache.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_memory.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_null.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_wincache.php | 84 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_xcache.php | 2 |
8 files changed, 84 insertions, 14 deletions
diff --git a/phpBB/includes/acm/acm_apc.php b/phpBB/includes/acm/acm_apc.php index 1a487f94ad..ab00b43e60 100644 --- a/phpBB/includes/acm/acm_apc.php +++ b/phpBB/includes/acm/acm_apc.php @@ -80,5 +80,3 @@ class acm extends acm_memory return apc_delete($this->key_prefix . $var); } } - -?>
\ No newline at end of file diff --git a/phpBB/includes/acm/acm_eaccelerator.php b/phpBB/includes/acm/acm_eaccelerator.php index 645067c199..7ae1557beb 100644 --- a/phpBB/includes/acm/acm_eaccelerator.php +++ b/phpBB/includes/acm/acm_eaccelerator.php @@ -117,5 +117,3 @@ class acm extends acm_memory return eaccelerator_rm($this->key_prefix . $var); } } - -?>
\ No newline at end of file diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 5c1876d006..0e60cd6940 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -728,5 +728,3 @@ class acm return @unlink($filename); } } - -?>
\ No newline at end of file diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php index e54fa36c38..527db71f80 100644 --- a/phpBB/includes/acm/acm_memcache.php +++ b/phpBB/includes/acm/acm_memcache.php @@ -134,5 +134,3 @@ class acm extends acm_memory return $this->memcache->delete($this->key_prefix . $var); } } - -?> diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php index 2936ea0bae..d248487846 100644 --- a/phpBB/includes/acm/acm_memory.php +++ b/phpBB/includes/acm/acm_memory.php @@ -435,5 +435,3 @@ class acm_memory return true; } } - -?>
\ No newline at end of file diff --git a/phpBB/includes/acm/acm_null.php b/phpBB/includes/acm/acm_null.php index fca67115a7..79f2b59c0f 100644 --- a/phpBB/includes/acm/acm_null.php +++ b/phpBB/includes/acm/acm_null.php @@ -152,5 +152,3 @@ class acm return false; } } - -?>
\ No newline at end of file diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php new file mode 100644 index 0000000000..0501ab74c5 --- /dev/null +++ b/phpBB/includes/acm/acm_wincache.php @@ -0,0 +1,84 @@ +<?php +/** +* +* @package acm +* @copyright (c) 2010 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +// Include the abstract base +if (!class_exists('acm_memory')) +{ + require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx"); +} + +/** +* ACM for WinCache +* @package acm +*/ +class acm extends acm_memory +{ + var $extension = 'wincache'; + + /** + * Purge cache data + * + * @return void + */ + function purge() + { + wincache_ucache_clear(); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + $success = false; + $result = wincache_ucache_get($this->key_prefix . $var, $success); + + return ($success) ? $result : false; + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return wincache_ucache_set($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return wincache_ucache_delete($this->key_prefix . $var); + } +} diff --git a/phpBB/includes/acm/acm_xcache.php b/phpBB/includes/acm/acm_xcache.php index d0a614660c..8be0ad0c48 100644 --- a/phpBB/includes/acm/acm_xcache.php +++ b/phpBB/includes/acm/acm_xcache.php @@ -117,5 +117,3 @@ class acm extends acm_memory return xcache_isset($this->key_prefix . $var); } } - -?>
\ No newline at end of file |