Example #1
0
 public function __construct($options)
 {
     parent::__construct($options);
     if (!extension_loaded('apc')) {
         $message = 'APC extension not loaded.';
         log_message('error', $message);
         parent::enabled(false, $message);
     }
 }
Example #2
0
 public function __construct($options)
 {
     parent::__construct($options);
     $ci =& get_instance();
     $this->_db = $ci->db;
     if (!$this->_db->table_exists('cache')) {
         // you'll see this error once when upgrading from non-cache enabled builds
         log_message('error', 'Cache table does not exist. Disabling cache.');
         parent::enabled(false);
     }
 }
Example #3
0
 private function _connect()
 {
     if ($this->_cache->connect($this->server, $this->port)) {
         if (method_exists($this->_cache, 'addServer') && !empty($this->extra_servers)) {
             foreach ($this->extra_servers as $server) {
                 $port = $this->port;
                 // detect port, only supports IP addresses
                 if (strpos($server, ':')) {
                     list($server, $port) = explode(':', $server);
                 }
                 $this->_cache->addServer($server, $port);
             }
         }
     } else {
         parent::enabled(false);
         log_message('error', 'Could not connect to Memcache server. Disabling cache.');
     }
 }