diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-09 19:09:13 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-09 19:09:13 +0000 |
commit | 1e14594d689a1150e922a5f5fe01956be4ccaf21 (patch) | |
tree | a1215d545ce0973a3553a8f6c14790c73172d5a8 /core/helpers/module.php | |
parent | bdd3cadf68b5d7f1581331690de28a04c7440aa8 (diff) |
Un hook the installer from load_modules, so testers can get to the scaffolding to install
Diffstat (limited to 'core/helpers/module.php')
-rw-r--r-- | core/helpers/module.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/helpers/module.php b/core/helpers/module.php index de81c0bb..5568ee7a 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -150,14 +150,15 @@ class module_Core { $core = Kohana::config_load('core'); $kohana_modules = $core['modules']; - // Check that we are installed. If not then head over to the installer. - $installed = Kohana::config("gallery.installed", false, false); - if (empty($installed)) { - $kohana_modules[] = DOCROOT . "installer"; - Kohana::config_set('core.modules', $kohana_modules); - $routes = Kohana::config("routes"); - $routes["_default"] = "installer"; - Kohana::config_set("routes", $routes); + // 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. + // Reverting from installer stage 1. + // @todo get rid of this extra error checking when we have an installer. + set_error_handler(array("module", "dummy_error_handler")); + try { + $modules = ORM::factory("module")->find_all(); + } catch (Exception $e) { return; } self::$module_names = array(); |