/** * Initialize instance * * @param Charcoal_Config $config configuration data */ public function configure($config) { parent::configure($config); $default_cache_root = Charcoal_ResourceLocator::getApplicationPath(s('cache')); $this->_cache_root = $config->getString('cache_root', $default_cache_root, TRUE); $this->_default_duration = $config->getInteger('default_duration', 0); $this->_cache_root_dir = new Charcoal_File($this->_cache_root); log_debug("system, debug, cache", "cache_root=[{$this->_cache_root}]"); log_debug("system, debug, cache", "default_duration=[{$this->_default_duration}]"); }
/** * Initialize instance * * @param Charcoal_Config $config configuration data */ public function configure($config) { parent::configure($config); $this->_host = $config->getString('host', 'localhost'); $this->_port = $config->getInteger('port', 11211); $this->_weight = $config->getInteger('weight', 100); $this->_default_duration = $config->getInteger('default_duration', 0); log_debug("system, debug, cache", "cache", "host=[{$this->_host}]"); log_debug("system, debug, cache", "cache", "port=[{$this->_port}]"); log_debug("system, debug, cache", "cache", "weight=[{$this->_weight}]"); log_debug("system, debug, cache", "cache", "default_duration=[{$this->_default_duration}]"); $this->_memcache->addServer(us($this->_host), ui($this->_port), TRUE, ui($this->_weight)); log_info("system, debug, cache", "cache", "server added."); }