From 26f0b4e44d90230f5a3f292b36f1e65b6eb32365 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 17 Dec 2008 19:04:20 +0000 Subject: Clear out module list in load_modules() before trying any db operations --- core/helpers/module.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'core/helpers') diff --git a/core/helpers/module.php b/core/helpers/module.php index c26a8257..2b9a919d 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -111,6 +111,12 @@ class module_Core { } public static function load_modules() { + // Reload module list from the config file since we'll do a refresh after calling install() + $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. @@ -122,11 +128,6 @@ class module_Core { return; } - // Reload module list from the config file since we'll do a refresh after calling install() - $core = Kohana::config_load('core'); - $kohana_modules = $core['modules']; - self::$module_names = array(); - self::$modules = array(); try { foreach ($modules as $module) { self::$module_names[] = $module->name; -- cgit v1.2.3