redis = new Redis(); $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT); if (defined('PHPBB_ACM_REDIS_PASSWORD')) { if (!$this->redis->auth(PHPBB_ACM_REDIS_PASSWORD)) { global $acm_type; trigger_error("Incorrect password for the ACM module $acm_type.", E_USER_ERROR); } } $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); $this->redis->setOption(Redis::OPT_PREFIX, $this->key_prefix); if (defined('PHPBB_ACM_REDIS_DB')) { if (!$this->redis->select(PHPBB_ACM_REDIS_DB)) { global $acm_type; trigger_error("Incorrect database for the ACM module $acm_type.", E_USER_ERROR); } } } /** * Unload the cache resources * * @return void */ function unload() { parent::unload(); $this->redis->close(); } /** * Purge cache data * * @return void */ function purge() { $this->redis->flushDB(); parent::purge(); } /** * Fetch an item from the cache * * @access protected * @param string $var Cache key * @return mixed Cached data */ function _read($var) { return $this->redis->get($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) { return $this->redis->setex($var, $ttl, $data); } /** * Remove an item from the cache * * @access protected * @param string $var Cache key * @return bool True if the operation succeeded */ function _delete($var) { if ($this->redis->delete($var) > 0) { return true; } return false; } } bit-branch'>topic/R9_0-64bit-branch Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2002-08-27 16:58:54 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2002-08-27 16:58:54 +0000
commita5dad137cbdff67109fd61b1367ae5f13d531d7a (patch)
tree23a7b5cb2e91549f452a2b8b7c615845a63ccabb /perl-install
parentd3a1c1b92ee65675587af0f70970ee3c296ead19 (diff)
downloaddrakx-a5dad137cbdff67109fd61b1367ae5f13d531d7a.tar
drakx-a5dad137cbdff67109fd61b1367ae5f13d531d7a.tar.gz
drakx-a5dad137cbdff67109fd61b1367ae5f13d531d7a.tar.bz2
drakx-a5dad137cbdff67109fd61b1367ae5f13d531d7a.tar.xz
drakx-a5dad137cbdff67109fd61b1367ae5f13d531d7a.zip
*** empty log message ***