diff options
| author | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 | 
|---|---|---|
| committer | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 | 
| commit | a06a38ae692551dc1c0416b835ce9924b3d9f7f5 (patch) | |
| tree | 1bb2c2b3d8d56668585513890afc1d641cead0b1 /phpBB/includes/acm/acm_wincache.php | |
| parent | 2db884ac2e5122be1db0582b76bf7204783a0c0d (diff) | |
| parent | 19a47dfbbc4265e33c14d6679b5693d80120db4b (diff) | |
| download | forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.gz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.bz2 forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.xz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.zip  | |
Merging with upstream 3.0.11
Diffstat (limited to 'phpBB/includes/acm/acm_wincache.php')
| -rw-r--r-- | phpBB/includes/acm/acm_wincache.php | 84 | 
1 files changed, 84 insertions, 0 deletions
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); +	} +}  | 
