+ switch($this->parent->cfg->db_access) {
+ case 'native':
+ if(($this->db = sqlite3_open($this->db_path)) === false) {
+ $this->throwError("Unable to connect to database:" . $this->getLastError());
+ $this->setConnStatus(false);
+ }
+ else {
+ sqlite3_create_function($this->db, 'basename', 1, 'basename');
+ $this->setConnStatus(true);
+ }
+ break;
+ case 'pdo':
+ try {
+ $this->db = new PDO("sqlite:".$this->db_path);
+ $this->setConnStatus(true);
+ }
+ catch (Exception $e) {
+ $this->throwError("Unable to connect to database:" . $e->getMessage());
+ $this->setConnStatus(false);
+ }
+ break;