type = DatabaseType::MYSQL; $this->grammar = new SqliteGrammar(); $this->connect($dbdata); } /** * {@inheritdoc} */ public function connect(array $dbdata = null) : void { $this->close(); $this->dbdata = $dbdata !== null ? $dbdata : $this->dbdata; $this->prefix = $dbdata['prefix']; try { $this->con = new \PDO($this->dbdata['db'] . ':' . $this->dbdata['path']); $this->con->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false); $this->con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->status = DatabaseStatus::OK; } catch (\PDOException $e) { $this->status = DatabaseStatus::MISSING_DATABASE; $this->con = null; } } }