From 5d56cf0d74f5910cba8e4fef248ab065959552b4 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 1 Mar 2016 01:45:37 +0000 Subject: [PATCH] parse_debug --- lib/php/db.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); } -- 2.47.3