memcache = new Memcache; foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u) { $parts = explode('/', $u); $this->memcache->addServer(trim($parts[0]), trim($parts[1])); } $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0; } /** * Unload the cache resources * * @return void */ function unload() { parent::unload(); $this->memcache->close(); } /** * Purge cache data * * @return void */ function purge() { $this->memcache->flush(); parent::purge(); } /** * Fetch an item from the cache * * @access protected * @param string $var Cache key * @return mixed Cached data */ function _read($var) { return $this->memcache->get($this->key_prefix . $var); } /** * 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) { if (!$this->memcache->replace($this->key_prefix . $var, $data, $this->flags, $ttl)) { return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl); } return true; } /** * Remove an item from the cache * * @access protected * @param string $var Cache key * @return bool True if the operation succeeded */ function _delete($var) { return $this->memcache->delete($this->key_prefix . $var); } } ?> 66fdd4890504b29cab22471a6ec64'>root/lib
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-29 14:27:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-29 14:27:22 +0000
commit5e684f005b866fdd4890504b29cab22471a6ec64 (patch)
treeb596bc3513b0592357344288cda684e49351cd31 /lib
parente898892446943e1654e6774aa46ec81fb816f51d (diff)
downloadperl-Hal-Cdroms-5e684f005b866fdd4890504b29cab22471a6ec64.tar
perl-Hal-Cdroms-5e684f005b866fdd4890504b29cab22471a6ec64.tar.gz
perl-Hal-Cdroms-5e684f005b866fdd4890504b29cab22471a6ec64.tar.bz2
perl-Hal-Cdroms-5e684f005b866fdd4890504b29cab22471a6ec64.tar.xz
perl-Hal-Cdroms-5e684f005b866fdd4890504b29cab22471a6ec64.zip
- save error in $hal_cdroms->{error}
- ->mount: do not set the mount point, HAL handles it
Diffstat (limited to 'lib')