From: Nicolas Boisselier Date: Mon, 23 May 2016 23:48:07 +0000 (+0100) Subject: Bed X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=dbb50bafe8c2a02980d4d77dfa1854f4922f49bd;p=nb.git Bed --- diff --git a/etc/dbs.php b/etc/dbs.php index 088c2d51..9b83f03c 100644 --- a/etc/dbs.php +++ b/etc/dbs.php @@ -11,175 +11,4 @@ foreach (array( ) as $file) { if (file_exists("$dir/$file.php")) require_once("$dir/$file.php"); } -/* -*/ - /* - $CONF2 = array( - array ( - 'host' => 'big.cascais.loc', - 'title' => 'Mysql Izi on Big', - 'default_table' => 'process', - 'user' => 'nico', - 'name' => 'izi', - 'tables' => - array ( - 'site' => - array ( - 'replace' => - array ( - 'idlang' => 'lang.id', - ), - ), - ), - 'type' => 'mysql', - ), - array ( - 'host' => 'admin.izideal.vpn', - 'type' => 'mysql', - 'name' => 'nb', - 'user' => 'nico', - 'Title' => 'Rent', - 'notice' => 'Micro foncier 4BE', - 'default_table' => 'rent', - 'tables' => - array ( - 'place' => - array ( - 'replace' => - array ( - 'id' => 'addr.addr', - ), - ), - 'rent' => - array ( - 'orderby' => 'start desc, end desc', - 'replace' => - array ( - 'idtenant' => 'tenant.name', - 'idplace' => 'addr.addr', - ), - 'row_parse_pre' => - Closure::__set_state(array( - )), - 'row_parse_post' => - Closure::__set_state(array( - )), - ), - ), - ), - array ( - 'title' => 'Mysql Izi on Admin', - 'host' => 'admin.izideal.vpn', - 'default_table' => 'process', - 'user' => 'izideal', - 'name' => 'izi', - 'tables' => - array ( - 'site' => - array ( - 'replace' => - array ( - 'idlang' => 'lang.id', - ), - ), - ), - 'type' => 'mysql', - ), - array ( - 'title' => 'Mysql Izi', - 'host' => 'sql.izideal.vpn', - 'default_table' => 'process', - 'user' => 'izideal', - 'name' => 'izi', - 'tables' => - array ( - 'site' => - array ( - 'replace' => - array ( - 'idlang' => 'lang.id', - ), - ), - ), - 'type' => 'mysql', - ), - array ( - 'title' => 'Puppetdb', - 'host' => 'big', - 'type' => 'pgsql', - 'user' => 'puppetdb', - 'default_table' => 'view_hosts', - 'tables' => - array ( - 'hosts' => - array ( - 'extras' => - array ( - 'last_compile' => - array ( - 'type' => 'text', - 'extra' => 'to_char(hosts.last_compile, \'YYYY-MM-DD HH:mm:ss\'::text)', - ), - 'last_freshcheck' => - array ( - 'type' => 'text', - 'extra' => 'to_char(hosts.last_freshcheck, \'YYYY-MM-DD HH:mm:ss\'::text)', - ), - 'updated_at' => - array ( - 'type' => 'text', - 'extra' => 'to_char(hosts.updated_at, \'YYYY-MM-DD HH:mm:ss\'::text)', - ), - 'created_at' => - array ( - 'type' => 'text', - 'extra' => 'to_char(hosts.created_at, \'YYYY-MM-DD HH:mm:ss\'::text)', - ), - 'test' => - array ( - 'type' => 'int', - 'extra' => 1, - ), - ), - ), - ), - 'name' => 'puppetdb', - ), - array ( - 'pdo' => 'sqlite:/opt/semantico/product/releases/sem_ui/db/semantico.db', - 'title' => 'Semantico UI', - 'default_table' => 'node', - 'tables' => - array ( - 'node' => - array ( - 'orderby' => '(SELECT value FROM fact WHERE idnode=id AND name=\'date_install\') DESC', - 'replace_' => - array ( - 'iddc' => 'dc.id', - ), - ), - ), - 'replace' => - array ( - 'SELECT name FROM dc WHERE id=\'@id\'' => '.node td.iddc', - ), - 'name' => 'ui', - ), - array ( - 'title' => 'RT', - 'name' => 'rt', - ), - array ( - 'pdo' => 'sqlite:/dev/shm/crypt.db', - 'name' => 'crypt', - ), - array ( - 'host' => 'admin.izideal.vpn', - 'user' => 'nico', - 'type' => 'mysql', - 'name' => 'wp', - ) -); -*/ ?> diff --git a/etc/dbs/nb.php b/etc/dbs/nb.php index 077c1444..96d594f3 100644 --- a/etc/dbs/nb.php +++ b/etc/dbs/nb.php @@ -3,6 +3,7 @@ $CONF['nb'] = array ( 'host' => 'admin.izideal.vpn', 'type' => 'mysql', 'name' => 'nb', + #'order' => '9', '_import' => array('_rent','_nico'), ); ?> diff --git a/etc/dbs/rent.php b/etc/dbs/rent.php index 5ec92484..f7c1807c 100644 --- a/etc/dbs/rent.php +++ b/etc/dbs/rent.php @@ -60,7 +60,7 @@ $CONF['_rent'] = array ( $CONF['rent'] = array ( 'order' => 1, 'pdo' => 'sqlite:/opt/rent/rent.db', - '_import' => '_rent', + #'_import' => '_nb', ); ?> diff --git a/lib/php/db.php b/lib/php/db.php index 480acb33..4fbaf61e 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -485,8 +485,8 @@ class Db extends nb { # Sort - self::hksort($h,'order'); - #uasort($h,create_function('$a,$b','$a_=isset($a["'.$k.'"])?$a["'.$k.'"]:-1;$b_=isset($b["'.$k.'"])?$b["'.$k.'"]:-1; return($b_-$a_);')); + #self::hksort($h,'order'); + uasort($h,create_function('$a,$b','$a_=isset($a["order"])?$a["order"]:-1;$b_=isset($b["order"])?$b["order"]:-1; return($b_-$a_);')); if (!$h) return false; #self::bye($h['puppetdb']); #if ($first !== false) debug ( self::ar_first($h) );