diff options
author | Nils Adermann <naderman@naderman.de> | 2010-12-13 17:14:36 +0100 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-12-13 17:14:36 +0100 |
commit | 18f74a7e10b01f4f6f916e2baa814b27b31fc8a9 (patch) | |
tree | c7068f8e9cb82587f97adb19a390cb69631b9b9f /phpBB/includes/acm | |
parent | adfa1656fb9d8b5bb601af1d7a6720884954d87a (diff) | |
parent | 5d8ddc748000623b8e705b9434a4133cdd8fcc19 (diff) | |
download | forums-18f74a7e10b01f4f6f916e2baa814b27b31fc8a9.tar forums-18f74a7e10b01f4f6f916e2baa814b27b31fc8a9.tar.gz forums-18f74a7e10b01f4f6f916e2baa814b27b31fc8a9.tar.bz2 forums-18f74a7e10b01f4f6f916e2baa814b27b31fc8a9.tar.xz forums-18f74a7e10b01f4f6f916e2baa814b27b31fc8a9.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/9851] "Search new posts" should require login.
[task/phpdoc] Added a phpdoc task to the build process
[task/phpdoc] Added a configuration file for phpDocumentor.
[feature/acm-wincache] Adding caching module for WinCache's User Cache.
[ticket/9939] Fix JavaScript error in admin recaptcha template
[ticket/9575] Also change 'administrate' to 'administer' in templates
[ticket/8736] guest can have 255 chars long username
[ticket/9928] Do not link "login to your board" to the "send statistics" page.
[ticket/9575] Change 'administrate' to 'administer'
[ticket/9921] Adding sample configuration file for the lighttpd webserver.
[ticket/9932] Add the Bing bot when converting
[ticket/9930] Redirect failes with open_basedir enabled.
[ticket/9910] Make sure S_BBCODE_ALLOWED exists when viewing PMs
Diffstat (limited to 'phpBB/includes/acm')
-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); + } +} |