From: Nicolas Boisselier Date: Mon, 26 Sep 2016 23:50:47 +0000 (+0100) Subject: cleaning X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=197a0a1dad64ac821bf2a0e3ed6f26c8876888fd;p=nb.git cleaning --- diff --git a/bin/nb-update b/bin/nb-update index 9adce95b..08f147f1 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -43,8 +43,7 @@ for repo in $(nb-repo-dirs); do su $user -c "$cmd" else echo "Wrong user current user=$USER repo user=$user" - echo - continue + false fi ret=$? diff --git a/etc/dbq.yaml b/etc/dbq.yaml index 2f3e6fc5..4c1f4af3 100644 --- a/etc/dbq.yaml +++ b/etc/dbq.yaml @@ -1,17 +1,6 @@ _mysql: type: mysql -crypt: - type: sqlite - host: /dev/shm/crypt.db - -rt: - type: pgsql - host: db.rt.semantico.net - name: rtdb - user: rtuser - title: 'RT' - izi: title: Izi Admin host: admin.izideal.vpn @@ -39,3 +28,7 @@ izi-dev: #user: nico _import: - izi + +crypt: + type: sqlite + host: /dev/shm/crypt.db diff --git a/etc/dbq/ui.php b/etc/dbq/ui.php index e2b1bd54..3ab53142 100644 --- a/etc/dbq/ui.php +++ b/etc/dbq/ui.php @@ -2,7 +2,7 @@ $DBQ['_ui'] = array( 'title' => 'Semantico UI', 'type' => 'sqlite', - 'host' => (file_exists('/opt/www/sem_ui/var/db/semantico.db') ? '/opt/www/sem_ui/var/db/semantico.db' : "$DIR_SQLITE/semantico.db"), + 'host' => (file_exists('/opt/www/sem_ui/var/db/semantico.db') ? '/opt/www/sem_ui/var/db/semantico.db' : "$DIR_SQLITE/semantico.sqlite"), 'default_table' => 'node', 'tables' => array( diff --git a/etc/profile.d/dbq.sh b/etc/profile.d/dbq.sh index f4186152..ae38b074 100644 --- a/etc/profile.d/dbq.sh +++ b/etc/profile.d/dbq.sh @@ -1,3 +1,5 @@ +[ -z "$DBQ_HOST" ] && DBQ_HOST='db.nbdom.net' + dbq2sqlite() { dbq f=text a=db.dump db.type=sqlite $@ } diff --git a/lib/php/db.php b/lib/php/db.php index ad4a54f7..978fe6d3 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -433,10 +433,12 @@ class Db extends nb { $sql = $this->method('tables'); - foreach ($this->conn->query($sql,PDO::FETCH_ASSOC) as $row) { - #debug($row); - $name = current($row); - $this->table($name,$row+['status'=>$row]); # add to this->tables too ! + if ($sql and !empty($this->conn)) { + foreach ($this->conn->query($sql,PDO::FETCH_ASSOC) as $row) { + #debug($row); + $name = current($row); + $this->table($name,$row+['status'=>$row]); # add to this->tables too ! + } } } @@ -975,7 +977,7 @@ class Db extends nb { $this->databases = []; $name = self::p('name',''); - if ($sql = $this->conf_type('databases')) { + if ($sql = $this->conf_type('databases') and !empty($this->conn)) { $fct = ''; if (is_array($sql)) list($sql,$fct) = count($sql)>1 ? $sql : [$sql[0],''];