summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-11 01:57:41 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-11 01:57:41 +0000
commit4312563e8b2f24dcef767849e00013aaa2b52c65 (patch)
treeacfd73faf668fb6d8f8f568e7c17ca731b2cfa3c
parent0033887ba858659b5e360baa69031055c98974f7 (diff)
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
-rw-r--r--core/helpers/module.php7
1 files changed, 3 insertions, 4 deletions
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) {