1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 01:24:06 +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

@@ -166,6 +166,28 @@ abstract class DibiDriver
/**
* Apply configuration alias or default values
*
* @param array connect configuration
* @param string key
* @param string alias key
* @return void
*/
protected static function prepare(&$config, $key, $alias=NULL)
{
if (isset($config[$key])) return;
if ($alias !== NULL && isset($config[$alias])) {
$config[$key] = $config[$alias];
unset($config[$alias]);
} else {
$config[$key] = NULL;
}
}
/**
* Internal: Executes the SQL query
*