]> git.nbdom.net Git - nb.git/commitdiff
parse_debug
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 01:45:37 +0000 (01:45 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 01:45:37 +0000 (01:45 +0000)
lib/php/db.php

index 93d713413bd091637878bfa345d581b1a13388cf..287912061e3d76a966db8beea3a15abd7559790f 100644 (file)
@@ -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();
     }