From: Nicolas Boisselier Date: Fri, 19 Jan 2018 01:23:18 +0000 (+0000) Subject: lib/php/db.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e1f21f9ee67123f753017167fe7363a1f03d9a5e;p=nb.git lib/php/db.php --- diff --git a/lib/php/db/config.php b/lib/php/db/config.php index ef935210..e44a9845 100644 --- a/lib/php/db/config.php +++ b/lib/php/db/config.php @@ -38,16 +38,6 @@ if (!empty($_SERVER['DBQ_CONF_DIR'])) { # NB 08.01.18: TODEL if (empty($DB_CONFS)) $DB_CONFS = array_merge([], - # ::ROOT_DIR -# NB 04.01.18 [ -# NB 04.01.18 Db::ROOT_DIR.'/etc/dbq.yml', -# NB 04.01.18 Db::ROOT_DIR.'/etc/dbq.yaml', -# NB 04.01.18 Db::ROOT_DIR.'/etc/dbq.php', -# NB 04.01.18 ], - (array)glob(Db::ROOT_DIR.'/etc/dbq/*.yml'), - (array)glob(Db::ROOT_DIR.'/etc/dbq/*.yaml'), - (array)glob(Db::ROOT_DIR.'/etc/dbq/*.php'), - # /etc [ '/etc/dbq.yml', @@ -68,6 +58,12 @@ if (empty($DB_CONFS)) $DB_CONFS = array_merge([], (array)glob($_SERVER['HOME'].'/.dbq/*.yaml'), (array)glob($_SERVER['HOME'].'/.dbq/*.php'), #] ), + + # ROOT_DIR + (array)glob(Db::ROOT_DIR.'/etc/dbq/*.yml'), + (array)glob(Db::ROOT_DIR.'/etc/dbq/*.yaml'), + (array)glob(Db::ROOT_DIR.'/etc/dbq/*.php'), + []); #bye($DB_CONFS); diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index f70750e7..d5e71480 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -348,26 +348,7 @@ class DbQ extends nb { if (!empty($this->db)) return $this->db; require_once(NB_ROOT.'/lib/php/db.php'); - // New - /* - global $DB_CONFS; - if(empty($DB_CONFS)) $DB_CONFS = []; - - if (!empty($_SERVER['DBQ_CONF_FILE'])) { - $DB_CONFS = array_merge($DB_CONFS,explode(' ',$_SERVER['DBQ_CONF_FILE'])); - } - - if (!empty($_SERVER['DBQ_CONF_DIR'])) { - foreach (explode(' ',$_SERVER['DBQ_CONF_DIR']) as $dir) { - $DB_CONFS = array_merge($DB_CONFS, - (array)glob($dir.'/*.yml'), - (array)glob($dir.'/*.yaml'), - (array)glob($dir.'/*.php'), - []); - } - } - */ - + // Load confs if (empty($DB_CONFS)) { require_once(NB_ROOT.'/lib/php/db/config.php'); } else {