You are here

public function SQLite3Cache::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php \Doctrine\Common\Cache\SQLite3Cache::__construct()

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

vendor/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));
}