You are here

public function SQLite3Cache::__construct in Plug 7

Constructor.

Calling the constructor will ensure that the database file and table exist and will create both if they don't.

Parameters

SQLite3 $sqlite:

string $table:

File

lib/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php, line 68

Class

SQLite3Cache
SQLite3 cache provider.

Namespace

Doctrine\Common\Cache

Code

public function __construct(SQLite3 $sqlite, $table) {
  $this->sqlite = $sqlite;
  $this->table = (string) $table;
  list($id, $data, $exp) = $this
    ->getFields();
  return $this->sqlite
    ->exec(sprintf('CREATE TABLE IF NOT EXISTS %s(%s TEXT PRIMARY KEY NOT NULL, %s BLOB, %s INTEGER)', $table, $id, $data, $exp));
}