function __construct($opt) { parent::__construct($opt); if (!file_exists($opt['path'])) { $db = sqlite_open($opt['path']); sqlite_query($db, 'CREATE TABLE data (key, value, created);'); sqlite_close($db); } $this->db = sqlite_open($opt['path']); }
function getCacheCtrl() { if (empty($this->Cache)) { require_once 'kvs/kvs.class.php'; $dir = $this->cacheDir; $this->Cache = XKeyValueStore::factory('sqlite', array('path' => $dir . "/cache.db")); } return $this->Cache; }