* Connect SQLite by PDO.

This commit is contained in:
zhouxin
2023-06-19 15:17:36 +08:00
parent 95304b29d4
commit 6eabf8aba2
2 changed files with 16 additions and 2 deletions
+14
View File
@@ -409,6 +409,7 @@ class baseRouter
$this->loadClass('filter', $static = true);
$this->loadClass('form', $static = true);
$this->loadClass('dbh', $static = true);
$this->loadClass('sqlite', $static = true);
$this->loadClass('dao', $static = true);
$this->loadClass('mobile', $static = true);
@@ -2871,6 +2872,19 @@ class baseRouter
}
}
/**
* 连接SQLite数据库。
* Connect SQLite database.
*
* @param object $params
* @access public
* @return object
*/
public function connectSqlite($params)
{
return new sqlite($params);
}
//-------------------- 错误处理方法(Error methods) ------------------//
/**
+2 -2
View File
@@ -56,7 +56,7 @@ class sqlite
* @access public
* @return void
*/
public function __construct()
public function __construct($params)
{
global $app, $config, $dbh;
$this->app = $app;
@@ -64,7 +64,7 @@ class sqlite
$this->config = $config;
$this->magicQuote = (version_compare(phpversion(), '5.4', '<') and function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc());
$this->connectSqlite();
$this->connectSqlite($params->file);
}
/**