summaryrefslogtreecommitdiff
path: root/core/helpers/module.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-16 08:05:07 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-16 08:05:07 +0000
commit54e07d07691be42f606b5a5346bf956257c598bd (patch)
treea06ca18a78c0970f7ac63669ec08fdd288f692fb /core/helpers/module.php
parentdf5f035ed17ef7873e40b026052af4e8cc2be6e4 (diff)
Get rid of the extra robust code we had in here to make the
scaffolding work when the Gallery wasn't installed yet. Now we force users through the installer.
Diffstat (limited to 'core/helpers/module.php')
-rw-r--r--core/helpers/module.php35
1 files changed, 7 insertions, 28 deletions
diff --git a/core/helpers/module.php b/core/helpers/module.php
index 82c69627..8f815b61 100644
--- a/core/helpers/module.php
+++ b/core/helpers/module.php
@@ -149,38 +149,17 @@ class module_Core {
// 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"];
+ $modules = ORM::factory("module")->find_all();
- 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.
- // 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;
- }
-
- try {
- foreach ($modules as $module) {
- self::$module_names[$module->name] = $module->name;
- self::$modules[$module->name] = $module;
- $kohana_modules[] = MODPATH . $module->name;
- }
-
- Kohana::config_set("core.modules", $kohana_modules);
- } catch (Exception $e) {
- self::$module_names = array();
- self::$modules = array();
+ foreach ($modules as $module) {
+ self::$module_names[$module->name] = $module->name;
+ self::$modules[$module->name] = $module;
+ $kohana_modules[] = MODPATH . $module->name;
}
+ Kohana::config_set("core.modules", $kohana_modules);
self::event("gallery_ready");
}
- static function dummy_error_handler() { }
/**
* Run a specific event on all active modules.
@@ -248,7 +227,7 @@ class module_Core {
$var->name = $name;
}
$var->value = $value;
- $var->save();
+ $var->save();
self::$var_cache[$module_name][$name] = $value;
}