public function __construct() { if (!extension_loaded('sqlite3')) { throw new Exception('SQLite cache configured but "sqlite3" PHP extension not installed.'); } $this->_db = new SQLite3($this->get_cache_directory() . '/' . $this->get_cache_name() . '.sqlite'); $this->_table = str_replace(array('.', '-'), '_', $this->get_cache_name()); // Check if we have a DB table corresponding to current cache name $result = $this->_db->query("SELECT name FROM sqlite_master WHERE type='table' AND name='{$this->_table}'"); $tables = $result->fetchArray(); if (count($tables) == 0 || $tables == false) { /** * Creating table for data */ $this->_db->query("CREATE TABLE {$this->_table} (module VARCHAR(255), identifier VARCHAR(255), value TEXT);"); $this->_db->query("CREATE INDEX {$this->_table}_identifier ON {$this->_table} (identifier);"); $this->_db->query("CREATE INDEX {$this->_table}_module ON {$this->_table} (module);"); /** * Creating table for tags */ $this->_db->query("CREATE TABLE {$this->_table}_tags (identifier VARCHAR(255), tag VARCHAR(255));"); $this->_db->query("CREATE INDEX {$this->_table}_tags_i ON {$this->_table}_tags (identifier, tag);"); } parent::__construct(); }
public function __construct() { if (!extension_loaded('memcache')) { throw new Exception('memcached cache configured but "Memcache" PHP extension not installed.'); } $this->memcache = new Memcache(); $this->memcache_operational = @$this->memcache->pconnect('localhost', 11211); if (!isset(midgardmvc_core::get_instance()->context->host)) { $this->name = 'MidgardMVC'; } else { $this->name = midgardmvc_core::get_instance()->context->host->name; } parent::__construct(); }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $this->cache_object = midgardmvc_core::get_instance()->hierarchy->get_root_node()->get_object(); }