From: Nicolas Boisselier Date: Wed, 2 Mar 2016 11:47:13 +0000 (+0100) Subject: error message X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=b719b2b4b94bebefb7bb6973196a94280aa5dda9;p=nb.git error message --- diff --git a/lib/php/db.php b/lib/php/db.php index 0466886b..a30f7b92 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -72,6 +72,9 @@ class db extends nb { 'pgsql', ))) $this->bye("unknow type = ".$this->type); #preg_match_all('/[:;](user|username|password)=([^;]*)/',$this->pdo,$m); bye($m); + if (preg_match('/^sqlite:(.*)$/',$this->pdo,$m) and !is_readable($m[1])) + $this->bye("Can't access database ".$m[1]); + ; $this->conn = new PDO($this->pdo,$this->username,$this->password,$this->options); if (isset($this->pdo_error)) $this->conn->setAttribute(PDO::ATTR_ERRMODE, $this->pdo_error); }