type: mysql
crypt:
- pdo: 'sqlite:/dev/shm/crypt.db'
+ type: sqlite
+ host: /dev/shm/crypt.db
rt:
pdo: 'pgsql:host=db.rt.semantico.net;port=5432;dbname=rtdb;user=rtuser;password='
title: 'RT'
izi:
- #pdo: 'mysql:host=admin.izideal.com;port=3306;dbname=izi'
title: Mysql Izi
host: sql.izideal.vpn
default_table: process
function connect_init() {
if (empty($this->pdo) and $this->type) $this->pdo = $this->type.':';
if (empty($this->type)) $this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',$this->pdo));
- if( !$this->type ) return false;
+ if (!$this->type) return false;
if ($this->type('use_path')) {
- $this->file = preg_replace('/^\w+:/','',$this->pdo);
- if ($p = $this->p('db.host')) $this->file = $p;
- $this->host = $this->file;
+ if ($p = $this->p('db.host')) $this->host = $p;
+ if (empty($this->host)) $this->host = preg_replace('/^\w+:/','',$this->pdo);
+ # Add file
+ if (trim($this->pdo,'pdo:'.$this->type)=='') $this->pdo .= $this->host;
} else {
if (!$this->type(null)) $this->bye("Unknow type = `".$this->type."`");
# Connect
- if ($this->type('use_path') and !is_readable($this->file)) {
- $this->bye("Can't read database file `".$this->file."` type=`$this->type`",false);
+ if ($this->type('use_path') and !is_readable($this->host)) {
+ $this->bye("Can't read database file `".$this->host."` type=`$this->type`",false);
}
try {