public $tables = array();
public $conn;
public $title;
+ public $name;
public $type;
public $help_criterias = array(
' * or % for wildcar',
#bye($db['conn']);
$this->conn = new PDO($db['conn']);
+ #if (empty($this->name)) $this->name = preg_replace('/^(?:(?:sqlite:.*(.*?)(\.\w+)?)|(?:.*?dbname=([^;]+).*?))$/','\1',$db['conn']);
+ if (empty($this->name) and preg_match('/(?:sqlite:|dbname=)([^;\.]+)/',$db['conn'],$m)) {
+ $this->name = $m[1];
+ }
+ if (empty($this->title)) $this->title = prettyText($this->name);
if ($this->type == 'sqlite') {
- if (empty($this->title)) $this->title = preg_replace('/^.*?:.*(.*?)(\.\w+)?$/','\1',$db['conn']);
-
$this->conn->sqliteCreateFunction('regexp',
function ($pattern, $data, $delimiter = '~', $modifiers = 'isuS') {
if (isset($pattern, $data) === true) {
function rows_begin_xml() {
echo ''
.'<?xml version=“1.0” encoding=“utf-8”?>'.PHP_EOL
- .'<db src="db.php" table="'.$this->name.'">'.PHP_EOL
+ .'<db name="'.$this->db->name.'" table="'.$this->name.'" type="'.$this->db->type.'">'.PHP_EOL
;
}