1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 17:29:53 +02:00

compatibility with Nette::Config

This commit is contained in:
David Grudl
2008-04-21 11:32:58 +00:00
parent 11a314ca96
commit 62f8c47410
2 changed files with 9 additions and 9 deletions

View File

@@ -161,23 +161,18 @@ class dibi
/**
* Creates a new DibiConnection object and connects it to specified database.
*
* @param array|string connection parameters
* @param array|string|Nette::Collections::IMap connection parameters
* @param string connection name
* @return DibiConnection
* @throws DibiException
*/
public static function connect($config = array(), $name = 0)
{
if (class_exists(/*Nette::*/'Debug', FALSE) && /*Nette::*/Debug::isEnabled()) {
if (class_exists(/*Nette::*/'Debug', FALSE)) {
/*Nette::*/Debug::addColophon(array(__CLASS__, 'getColophon'));
}
if (is_array($config) || $config instanceof /*Nette::Collections::*/IMap) {
$config['name'] = $name;
} else {
$config .= '&name=' . urlencode($name);
}
return self::$connection = self::$registry[$name] = new DibiConnection($config);
return self::$connection = self::$registry[$name] = new DibiConnection($config, $name);
}