/** * Initializes this application component. * This method is required by the {@link IApplicationComponent} interface. * It checks the availability of memcache. * @throws CException if APC cache extension is not loaded or is disabled. */ public function init() { parent::init(); if (!extension_loaded('apc')) { throw new CException(Yii::t('yii', 'CApcCache requires PHP apc extension to be loaded.')); } }
/** * Initializes this application component. * This method is required by the {@link IApplicationComponent} interface. * It creates the memcache instance and adds memcache servers. * @throws CException if memcache extension is not loaded */ public function init() { parent::init(); $servers = $this->getServers(); $cache = $this->getMemCache(); if (count($servers)) { foreach ($servers as $server) { if ($this->useMemcached) { $cache->addServer($server->host, $server->port, $server->weight); } else { $cache->addServer($server->host, $server->port, $server->persistent, $server->weight, $server->timeout, $server->status); } } } else { $cache->addServer('localhost', 11211); } }
/** * Initializes this application component. * This method is required by the {@link IApplicationComponent} interface. * It creates the redis instance and adds redis servers. * @throws CException if redis extension is not loaded */ public function init() { $this->_server = CMap::mergeArray($this->_serverDefaults, $this->_server); parent::init(); $this->getRedis(); }
/** * Initializes this application component. * This method is required by the {@link IApplicationComponent} interface. * It creates the redis instance and adds redis servers. * @throws CException if redis extension is not loaded */ public function init() { parent::init(); $this->getRedis(); }