From: Nicolas Boisselier Date: Tue, 1 Mar 2016 01:45:37 +0000 (+0000) Subject: parse_debug X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=5d56cf0d74f5910cba8e4fef248ab065959552b4;p=nb.git parse_debug --- diff --git a/lib/php/db.php b/lib/php/db.php index 93d71341..28791206 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -58,7 +58,9 @@ class db extends nb { function __construct($db) { $db = is_scalar($db) ? array('name' => $db) : $db; - foreach ($db as $k=>$v) $this->$k = $v; + if (is_array($db)) { + foreach ($db as $k=>$v) $this->$k = $v; + } $this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',$this->pdo)); #preg_match_all('/[:;](user|username|password)=([^;]*)/',$this->pdo,$m); bye($m); @@ -220,7 +222,7 @@ class db extends nb { $sql = "SHOW TABLES"; } else { - err('db.tables(): Unknow db type: '.$this->type); + $this->bye('db.tables(): Unknow db type: '.$this->type); return array(); }