From 4312563e8b2f24dcef767849e00013aaa2b52c65 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 11 Jan 2009 01:57:41 +0000 Subject: Reset module_names / modules early in load_modules() so that unit test framework can dump the loaded modules after switching databases even if the modules table doesn't exist yet --- core/helpers/module.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'core/helpers/module.php') diff --git a/core/helpers/module.php b/core/helpers/module.php index 9574c9c5..b2b24605 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -152,6 +152,9 @@ class module_Core { $core = Kohana::config_load('core'); $kohana_modules = $core['modules']; + self::$module_names = array(); + self::$modules = array(); + // This is one of the first database operations that we'll do, so it may fail if there's no // install yet. Try to handle this situation gracefully expecting that the scaffolding will // Do The Right Thing. @@ -163,10 +166,6 @@ class module_Core { } catch (Exception $e) { return; } - self::$module_names = array(); - self::$modules = array(); - - $modules = ORM::factory("module")->find_all(); try { foreach ($modules as $module) { -- cgit v1.2.3