mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 05:37:39 +02:00
This commit is contained in:
@@ -51,11 +51,6 @@ class DibiMySqlDriver extends DibiDriver
|
|||||||
if (empty($config['host'])) $config['host'] = 'localhost';
|
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);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +60,11 @@ class DibiMySqlDriver extends DibiDriver
|
|||||||
{
|
{
|
||||||
$config = $this->config;
|
$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
|
// some errors aren't handled. Must use $php_errormsg
|
||||||
if (function_exists('ini_set'))
|
if (function_exists('ini_set'))
|
||||||
$save = ini_set('track_errors', TRUE);
|
$save = ini_set('track_errors', TRUE);
|
||||||
|
@@ -54,8 +54,7 @@ class DibiPdoDriver extends DibiDriver
|
|||||||
|
|
||||||
protected function connect()
|
protected function connect()
|
||||||
{
|
{
|
||||||
$config = $this->config;
|
return new PDO($this->config['dsn'], $this->config['username'], $this->config['password']);
|
||||||
return new PDO($config['dsn'], $config['username'], $config['password']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user