From 7346022dcfadf628e8e3e89e31739ddcc02ead05 Mon Sep 17 00:00:00 2001 From: Michel Kollenhoven Date: Thu, 26 Dec 2013 16:14:24 +0000 Subject: Allow unsetting the db (ORM::set_db(null)) to make the test work again --- idiorm.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'idiorm.php') diff --git a/idiorm.php b/idiorm.php index 7ac1652..143ecb7 100644 --- a/idiorm.php +++ b/idiorm.php @@ -279,8 +279,10 @@ public static function set_db($db, $connection_name = self::DEFAULT_CONNECTION) { self::_setup_db_config($connection_name); self::$_db[$connection_name] = $db; - self::_setup_identifier_quote_character($connection_name); - self::_setup_limit_clause_style($connection_name); + if(!is_null(self::$_db[$connection_name])) { + self::_setup_identifier_quote_character($connection_name); + self::_setup_limit_clause_style($connection_name); + } } /** -- cgit v1.2.3