* Connect SQLite by PDO.
This commit is contained in:
@@ -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) ------------------//
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user