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:
@@ -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]'");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user