示例#1
0
 public function __construct($filename = false)
 {
     if (!$filename) {
         $filename = dirname(__FILE__) . '/palma.db';
     }
     trace("db file = {$filename}");
     parent::__construct($filename);
     // Wait up to 10000 ms when the database is locked.
     $this->busyTimeout(10000);
     // Create any missing tables.
     $this->exec(self::SQL_CREATE_TABLES);
 }
 function __construct($dbPath)
 {
     parent::__construct($dbPath, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
     // Preparing annotation detection
     $this->isDevMode = true;
     $this->config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . "/../../src"), $this->isDevMode);
     // Creating entity manager
     $this->conn = array('driver' => 'pdo_sqlite', 'path' => $dbPath);
     $this->entityManager = EntityManager::create($this->conn, $this->config);
     // Checking table
     $this->checkTableCreation();
 }
示例#3
0
文件: DB.php 项目: kd2org/garradin
 public function __construct($create = false)
 {
     $flags = SQLITE3_OPEN_READWRITE;
     if ($create) {
         $flags |= SQLITE3_OPEN_CREATE;
     }
     parent::__construct(DB_FILE, $flags);
     $this->enableExceptions(true);
     // Activer les contraintes des foreign keys
     $this->exec('PRAGMA foreign_keys = ON;');
     $this->createFunction('transliterate_to_ascii', ['Garradin\\Utils', 'transliterateToAscii']);
     $this->createFunction('base64', 'base64_encode');
     $this->createFunction('rank', [$this, 'sql_rank']);
 }
示例#4
0
 function __construct($string)
 {
     parent::__construct($string);
 }
示例#5
0
 function __construct($dbFilename, $flags = SQLITE3_OPEN_READWRITE)
 {
     parent::__construct($dbFilename, $flags);
 }
示例#6
0
文件: DboSqlite.php 项目: spinit/osy
 public function __construct($str_cn = '')
 {
     list($type, $path) = explode(':', $str_cn);
     $this->__par['filename'] = $path;
     parent::__construct($path);
 }
 function __construct($dbPath)
 {
     parent::__construct($dbPath, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
 }