}
$name = basename($file,'.db');
- $id = "${name}-sqlite";
+ $id = $name."-sqlite";
if (empty($DBQ[$name])) $id = $name;
if (!isset($DBQ[$id])) $DBQ[$id] = [
# NB 10.09.18 ];
public $conn;
- public $pdo;
+ public $pdo = '';
public $options = [ # See: http://php.net/manual/en/pdo.error-handling.php
PDO::ATTR_ERRMODE => DB_DEFAUL_ERRMODE,
PDO::ATTR_TIMEOUT => 0,
];
- public $host = null;
+ public $host = '';
public $port = null;
+ public $dbname = null;
public $user = null;
public $password = null;
public $charset = 'utf8';
# Classes
public $out;
+ # Others
+ public $is_html;
+ private $_tables;
+ private $databases;
+
function __construct($opt = []) {
# Args defaults
$this->$k = $v;
}
- if (empty($this->type)) $this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',$this->pdo));
+ if (empty($this->type)) $this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',''.$this->pdo));
if (!$this->type) return false;
if ($v = $this->p('db_host')) $this->host = $v;
public static function pdo2h($pdo) {
$hash = [];
- if (preg_match('/^(\w+):(.*)/',$pdo,$m)) {
+ if (preg_match('/^(\w+):(.*)/',''.$pdo,$m)) {
$hash['type'] = $m[1];
$pdo = $m[2];
}
# YES - 'use_path'
- while (preg_match('/^(\w+)=([^;]*)(?:;?)(.*?)$/',$pdo,$m)) {
+ while (preg_match('/^(\w+)=([^;]*)(?:;?)(.*?)$/',''.$pdo,$m)) {
if ($m[1] == 'dbname') $m[1] = 'name';
$hash[$m[1]] = $m[2];
$pdo = $m[3];
public $key = 0;
public $uniq = 0;
public $index = 0;
+ public $size;
public $default;
public $autoincrement;
public $extra;
public $count;
public $engine;
public $created;
+ public $base;
+ private $_create_temporary;
+ private $_fields;
public static $is_admin = true;
# NB 28.07.18 public $key_preff = '_key_';
public $key_preff = '';
public $show_url_sort = true;
public $show_header = true;
+ # Others
+ private $tot;
+ private $limit;
+ private $status;
+
function __construct($name,$opt=[]) {
if (!is_scalar($name)) {
}
// Add others
- foreach ($opt as $k => $v) { $this->$k = $v; }
+ foreach ($opt as $k => $v) {
+ if (property_exists($this,$k)) $this->$k = $v;
+ }
if (empty($this->db()->limit)) {
if ($this->p('paged')) {
'table' => $this,
'name' => $row['name'],
'type' => strtolower($row['type']),
- 'key' => (preg_match('/^(f.*|no|0)?\s*$/i',$row['key']) ? 0 : 1),
+ 'key' => (preg_match('/^(f.*|no|0)?\s*$/i',''.$row['key']) ? 0 : 1),
'index' => (empty($indexes[$row['name']]) ? 0 : $indexes[$row['name']]),
'null' => (preg_match('/^(f.*|no|0)?\s*$/i',$row['null']) ? 0 : 1),
'extra' => (isset($row['extra']) ? $row['extra'] : null), # !!! nothing todo with array $extra, this info from the sql server
// No empty values
$v = isset($values[$k]) ? $values[$k] : null;
- if (strcmp($v,'')==0 or $v=='!' or $v=='~') continue;
+ if (strcmp(''.$v,'')==0 or $v=='!' or $v=='~') continue;
// Equal / Not Equal
$equal = '=';
* Return the head Accept from the client
*/
public static function client_content_type($default='') {
- $v = explode(',', self::client_header('Accept'));
+ $v = explode(',', ''.self::client_header('Accept'));
return ( ($v and $v[0] != '*/*') ? $v[0] : $default );
}
$type = '';
foreach (array_keys(self::$types) as $t) {
- if (preg_match("@^\w+/$t@",self::client_header('Accept'))) return $t;
+ if (preg_match("@^\w+/$t@",''.self::client_header('Accept'))) return $t;
}
return $type;
# Others
public $explode_args = '&';
+ private $http;
# Object
public $page;