diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-12 08:41:48 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-12 08:41:48 +0000 |
commit | e12451cf1033e6b6cfa8e278894ccac3098ddd84 (patch) | |
tree | 4d73d5fea4dcc7d102aab4593ef2e56e8f2c3536 /core/controllers | |
parent | 7e4d13d9bdc43ecc3b6cdd7144c40d70cda11c5a (diff) |
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.
Diffstat (limited to 'core/controllers')
-rw-r--r-- | core/controllers/welcome.php | 10 |
1 files changed, 3 insertions, 7 deletions
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"); } |