mirror of
https://github.com/dg/dibi.git
synced 2025-10-24 19:26:10 +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:
@@ -58,6 +58,18 @@ class DibiOdbcDriver extends NObject implements DibiDriverInterface
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('odbc')) {
|
||||
throw new DibiDriverException("PHP extension 'odbc' is not loaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connects to a database
|
||||
*
|
||||
@@ -74,11 +86,6 @@ class DibiOdbcDriver extends NObject implements DibiDriverInterface
|
||||
if (!isset($config['password'])) $config['password'] = ini_get('odbc.default_pw');
|
||||
if (!isset($config['dsn'])) $config['dsn'] = ini_get('odbc.default_db');
|
||||
|
||||
if (!extension_loaded('odbc')) {
|
||||
throw new DibiException("PHP extension 'odbc' is not loaded");
|
||||
}
|
||||
|
||||
|
||||
if (empty($config['persistent'])) {
|
||||
$this->connection = @odbc_connect($config['dsn'], $config['username'], $config['password']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user