]> git.nbdom.net Git - nb.git/commitdiff
Bed
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 May 2016 23:48:07 +0000 (00:48 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 May 2016 23:48:07 +0000 (00:48 +0100)
etc/dbs.php
etc/dbs/nb.php
etc/dbs/rent.php
lib/php/db.php

index 088c2d5141dc7d9a762db81766d2cf1981a7ba9b..9b83f03c44d0c19f48809ea1a6793f1ede5f57d8 100644 (file)
@@ -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',
-  )
-);
-*/
 ?>
index 077c144499b4a9ffe38c08a365af05cef9753b85..96d594f3408ff11b72b014978e279e780b166aaf 100644 (file)
@@ -3,6 +3,7 @@ $CONF['nb'] = array (
   'host' => 'admin.izideal.vpn',
   'type' => 'mysql',
   'name' => 'nb',
+  #'order' => '9',
   '_import' => array('_rent','_nico'),
 );
 ?>
index 5ec92484a1c8cab0bb763611123154fe9c918b79..f7c1807c208ff0e431ab510cbba4a6869e91dfcf 100644 (file)
@@ -60,7 +60,7 @@ $CONF['_rent'] = array (
 $CONF['rent'] = array (
   'order' => 1,
   'pdo' => 'sqlite:/opt/rent/rent.db',
-  '_import' => '_rent',
+  #'_import' => '_nb',
 );
 
 ?>
index 480acb3307a26bc21d6f614a03c60258b25f6cf1..4fbaf61ea84394904950581bb9ca9c5edfb138ec 100644 (file)
@@ -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) );