mirror of
https://github.com/dg/dibi.git
synced 2025-02-22 09:53:11 +01:00
This commit is contained in:
parent
799dfcc65e
commit
7c693a26fb
@ -51,11 +51,6 @@ class DibiMySqlDriver extends DibiDriver
|
||||
if (empty($config['host'])) $config['host'] = 'localhost';
|
||||
}
|
||||
|
||||
if (isset($config['protocol']) && $config['protocol'] === 'unix') // host can be socket
|
||||
$host = ':' . $config['host'];
|
||||
else
|
||||
$host = $config['host'] . (empty($config['port']) ? '' : ':'.$config['port']);
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
@ -65,6 +60,11 @@ class DibiMySqlDriver extends DibiDriver
|
||||
{
|
||||
$config = $this->config;
|
||||
|
||||
if (isset($config['protocol']) && $config['protocol'] === 'unix') // host can be socket
|
||||
$host = ':' . $config['host'];
|
||||
else
|
||||
$host = $config['host'] . (empty($config['port']) ? '' : ':'.$config['port']);
|
||||
|
||||
// some errors aren't handled. Must use $php_errormsg
|
||||
if (function_exists('ini_set'))
|
||||
$save = ini_set('track_errors', TRUE);
|
||||
|
@ -54,8 +54,7 @@ class DibiPdoDriver extends DibiDriver
|
||||
|
||||
protected function connect()
|
||||
{
|
||||
$config = $this->config;
|
||||
return new PDO($config['dsn'], $config['username'], $config['password']);
|
||||
return new PDO($this->config['dsn'], $this->config['username'], $this->config['password']);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user