From 38aa393dc3c269dd7e905fe26ad99ad080432b91 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 25 Feb 2015 15:10:48 +0100 Subject: [PATCH] dibi: named connections are allowed [Closes #161] Partially reverts commit a923ce7ecbd8db2c8ea0448d8056be584fe63fca. --- dibi/libs/Dibi.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dibi/libs/Dibi.php b/dibi/libs/Dibi.php index 2aaf8296..0a30f31c 100644 --- a/dibi/libs/Dibi.php +++ b/dibi/libs/Dibi.php @@ -86,14 +86,12 @@ class dibi /** * Creates a new DibiConnection object and connects it to specified database. * @param mixed connection parameters + * @param string connection name * @return DibiConnection * @throws DibiException */ public static function connect($config = array(), $name = 0) { - if ($name) { - trigger_error(__METHOD__ . '(): named connections are deprecated.', E_USER_DEPRECATED); - } return self::$connection = self::$registry[$name] = new DibiConnection($config, $name); } @@ -120,6 +118,7 @@ class dibi /** * Retrieve active connection. + * @param string connection registy name * @return DibiConnection * @throws DibiException */ @@ -133,8 +132,6 @@ class dibi return self::$connection; } - trigger_error(__METHOD__ . '(): named connections are deprecated.', E_USER_DEPRECATED); - if (!isset(self::$registry[$name])) { throw new DibiException("There is no connection named '$name'."); }