1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-22 09:53:11 +01:00
This commit is contained in:
David Grudl 2007-04-25 06:55:10 +00:00
parent 799dfcc65e
commit 7c693a26fb
2 changed files with 6 additions and 7 deletions

View File

@ -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);

View File

@ -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']);
}