From: Nicolas Boisselier Date: Wed, 25 May 2016 16:23:30 +0000 (+0100) Subject: a=db.dbs X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=dc674dd6bbb264bcc591c97180852f8685fbd034;p=nb.git a=db.dbs --- diff --git a/lib/php/db.php b/lib/php/db.php index a5c9803a..b29295c9 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -412,6 +412,8 @@ class Db extends nb { if (self::p('hash') or self::p('all')) { $fields = ['id','name','host','type']; $dbs = []; + $name = self::p('name',''); + $type = self::p('type',''); foreach ($this->conf as $id => $attr) { $d = new Db(); foreach ($attr as $k=>$v) $d->$k = $v; @@ -420,6 +422,8 @@ class Db extends nb { foreach ($fields as $k) { if (!isset($d->$k)) continue; $db[$k] = $d->$k; } + if (!empty($name) and strpos($db['name'],$name) === false) continue; + if (!empty($type) and strpos($db['type'],$type) === false) continue; $dbs[] = $db; } $return = $this->out($dbs,$fields);