From e12451cf1033e6b6cfa8e278894ccac3098ddd84 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Dec 2008 08:41:48 +0000 Subject: Refaactor module::install() and module::uninstall() out of the scaffolding and unit test code so that we can use it consistently. This fixes an issue where adding a module was not refreshing the statically cached module list causing the test framework to break. --- core/controllers/welcome.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'core/controllers') diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index 9d3ca996..5e76789c 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -74,12 +74,7 @@ class Welcome_Controller extends Template_Controller { if ($module_name != "core") { require_once(DOCROOT . "modules/${module_name}/helpers/${module_name}_installer.php"); } - $modules = Kohana::config('core.modules'); - $modules[] = MODPATH . $module_name; - Kohana::config_set('core.modules', $modules); - - Kohana::log("debug", "${module_name}_install (initial)"); - call_user_func(array("${module_name}_installer", "install")); + module::install($module_name); } url::redirect("welcome"); @@ -109,8 +104,9 @@ class Welcome_Controller extends Template_Controller { $db->query("DROP TABLE `$table`"); } set_error_handler($old_handler); + } else { + module::uninstall($module_name); } - call_user_func(array("{$module_name}_installer", "uninstall")); url::redirect("welcome"); } -- cgit v1.2.3