mirror of
https://github.com/dg/dibi.git
synced 2025-10-22 18:26:13 +02:00
* better syntax highlighting
* all drivers checks for extension in constructor * DibiMySqlDriver - charset is set by mysql_set_charset * DibiMySqliDriver - charset is set by mysqli_set_charset
This commit is contained in:
@@ -57,6 +57,7 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
private $buffered;
|
||||
|
||||
|
||||
/**
|
||||
* Date and datetime format
|
||||
* @var string
|
||||
@@ -64,6 +65,19 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
|
||||
private $fmtDate, $fmtDateTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('sqlite')) {
|
||||
throw new DibiDriverException("PHP extension 'sqlite' is not loaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connects to a database
|
||||
*
|
||||
@@ -76,10 +90,6 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
|
||||
$this->fmtDate = isset($config['format:date']) ? $config['format:date'] : 'U';
|
||||
$this->fmtDateTime = isset($config['format:datetime']) ? $config['format:datetime'] : 'U';
|
||||
|
||||
if (!extension_loaded('sqlite')) {
|
||||
throw new DibiException("PHP extension 'sqlite' is not loaded");
|
||||
}
|
||||
|
||||
$errorMsg = '';
|
||||
if (empty($config['persistent'])) {
|
||||
$this->connection = @sqlite_open($config['database'], 0666, $errorMsg);
|
||||
@@ -116,8 +126,6 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
|
||||
*/
|
||||
public function query($sql)
|
||||
{
|
||||
$errorMsg = NULL;
|
||||
|
||||
DibiDriverException::catchError();
|
||||
if ($this->buffered) {
|
||||
$this->resultset = sqlite_query($this->connection, $sql);
|
||||
|
Reference in New Issue
Block a user