1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-23 02:36:04 +02:00

* added configuration aliases (user -> username, pass -> password)

* dibi::$defaultDriver
This commit is contained in:
David Grudl
2007-10-26 17:44:24 +00:00
parent 879bbeba1f
commit 39c62c1cd5
11 changed files with 79 additions and 73 deletions

View File

@@ -31,10 +31,9 @@ class DibiMsSqlDriver extends DibiDriver
*/
public function __construct($config)
{
if (!isset($config['host'])) $config['host'] = NULL;
if (!isset($config['username'])) $config['username'] = NULL;
if (!isset($config['password'])) $config['password'] = NULL;
self::prepare($config, 'username', 'user');
self::prepare($config, 'password', 'pass');
self::prepare($config, 'host');
parent::__construct($config);
}
@@ -58,7 +57,7 @@ class DibiMsSqlDriver extends DibiDriver
throw new DibiDatabaseException("Can't connect to DB");
}
if (!empty($config['database']) && !@mssql_select_db($config['database'], $connection)) {
if (isset($config['database']) && !@mssql_select_db($config['database'], $connection)) {
throw new DibiDatabaseException("Can't select DB '$config[database]'");
}