From: Nicolas Boisselier Date: Tue, 30 Aug 2016 11:21:26 +0000 (+0200) Subject: fix bug with type X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2ca5bc2b3ade04228a068c0d1096e943c5acbb16;p=nb.git fix bug with type --- diff --git a/etc/dbs.yaml b/etc/dbs.yaml index c7b26110..55d64148 100644 --- a/etc/dbs.yaml +++ b/etc/dbs.yaml @@ -42,16 +42,8 @@ izi-dev: _import: - izi -media: - host: ks358898.izideal.vpn - name: mysql - type: mysql - _import: - - _nico - postfix: - #pdo: 'mysql:host=media.izideal.vpn;port=3306;dbname=postfix' title: Postfix on Izideal - host: media.izideal.vpn + host: mail.izideal.vpn user: postfix type: mysql diff --git a/etc/dbs/nb.php b/etc/dbs/nb.php index 733aa334..c1f06de7 100644 --- a/etc/dbs/nb.php +++ b/etc/dbs/nb.php @@ -12,6 +12,7 @@ $CONF['nb'] = array( $CONF['nb-sqlite'] = array ( 'pdo' => 'sqlite:'.nb::untilde('~nico/ownCloud/var/lib/sqlite/nb.db'), + 'type' => 'sqlite', '_import' => '_rent', ); diff --git a/lib/php/db.php b/lib/php/db.php index 094c45e8..2bf972f2 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -894,14 +894,18 @@ class Db extends nb { $attr['_no_connect'] = true; $attr['id'] = $id; $d = new Db($attr); - if (!empty($name) and !$this->str_match($d->name,$name)) continue; - if (!empty($type) and !$this->str_match($d->type,$type)) continue; + #debug([$d->id,$d::$type]); $db = []; foreach ($fields as $k) { - if (!isset($d->$k)) continue; $db[$k] = $d->$k; + #if (isset($d::$k)) $db[$k] = $d::$k; + if ($k=='type' and isset($d::$type)) $db[$k] = $d::$type; + elseif (isset($d->$k)) $db[$k] = $d->$k; } + if (!empty($name) and !$this->str_match($db['name'],$name)) continue; + if (!empty($type) and !$this->str_match($db['type'],$type)) continue; + $dbs[] = $db; } diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 723654a0..79fde1c6 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -633,7 +633,9 @@ Class Table extends nb { #return false; # Test if type exists because of a bug from shell.php - if ($this->db()->type) $this->fields(); +# NB 30.08.16 if ($this->db()->type) $this->fields(); + #$db = $this->db(); + #if ($db::$type) $this->fields(); foreach ($extras as $k => $v) {