1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-26 07:24:25 +02:00
This commit is contained in:
David Grudl
2007-11-15 00:19:41 +00:00
parent 6bfa40f594
commit c174e20135
5 changed files with 13 additions and 38 deletions

View File

@@ -93,20 +93,17 @@ class DibiMySqlDriver extends NObject implements DibiDriverInterface
}
}
if (empty($config['socket'])) {
$host = $config['host'] . (empty($config['port']) ? '' : ':' . $config['port']);
} else {
$host = ':' . $config['socket'];
}
NException::catchError('DibiDatabaseException');
if (empty($config['persistent'])) {
$this->connection = @mysql_connect($host, $config['username'], $config['password'], TRUE, $config['options']);
} else {
$this->connection = @mysql_pconnect($host, $config['username'], $config['password'], $config['options']);
}
NException::restore();
if (!is_resource($this->connection)) {
throw new DibiDatabaseException(mysql_error(), mysql_errno());