protected final function __construct() { if (!$this->setPath()) { return; } $this->_mode = 'File'; //Run the parent constructor parent::__construct(); }
protected final function __construct() { //Make sure we can use APC if (!extension_loaded('APC') || !ini_get('apc.enabled')) { return; } $this->_mode = 'APC'; //Run the parent constructor parent::__construct(); }
protected final function __construct() { global $glob; $this->_mode = 'Memcached'; $this->_memcached = new memcached(); $memcache_servers = isset($glob['memcached_servers']) ? $glob['memcached_servers'] : array(array('127.0.0.1', 11211)); $this->_memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); if (!count($this->_memcached->getServerList())) { $this->_memcached->addServers($memcache_servers); } //Run the parent constructor parent::__construct(); }
protected final function __construct() { global $glob; $this->_mode = 'Memcache'; $this->_memcache = new Memcache(); $memcache_host = isset($glob['memcache_host']) ? $glob['memcache_host'] : '127.0.0.1'; $memcache_post = isset($glob['memcache_post']) ? $glob['memcache_post'] : '11211'; if (!$this->_memcache->connect($memcache_host, $memcache_post)) { trigger_error("Couldn't initiate Memcache. Please set 'memcache_host' and 'memcache_port' in the includes/global.inc.php file.", E_USER_WARNING); } //Run the parent constructor parent::__construct(); }
protected final function __construct() { global $glob; require CC_INCLUDES_DIR . "/lib/predis/autoload.php"; Predis\Autoloader::register(); try { if (isset($glob['redis_parameters']) && isset($glob['redis_options'])) { $this->redis_client = new Predis\Client($glob['redis_parameters'], $glob['redis_options']); } elseif (isset($glob['redis_parameters'])) { $this->redis_client = new Predis\Client($glob['redis_parameters']); } else { $this->redis_client = new Predis\Client(); } } catch (Predis\Connection\ConnectionException $e) { trigger_error($e->getMessage()); return; } $this->_mode = 'Redis'; //Run the parent constructor parent::__construct(); }
protected final function __construct() { $this->_mode = 'XCache'; //Run the parent constructor parent::__construct(); }