Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function __construct($name)
 {
     parent::__construct($name);
     if ($res = @file_get_contents($this->getDir() . '/' . $this->name . 'Cache' . $this->mime)) {
         $this->data = json_decode($res, true);
     }
 }
 /**
  * @inheritdoc
  */
 public function __construct($name)
 {
     parent::__construct($name);
     try {
         $this->db = new PDO('sqlite:' . $this->getDir() . '/' . $name . 'Cache' . $this->mime);
         $this->db->query('CREATE TABLE IF NOT EXISTS `cache`(
           `id` INTEGER PRIMARY KEY AUTOINCREMENT,
           `key` TEXT NOT NULL,
           `value` TEXT,
           `expires` INTEGER
         )');
     } catch (PDOException $e) {
         echo 'SQLiteCacheProvider: ' . $e->getMessage();
         die;
     }
 }