diff options
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/module.php | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/core/helpers/module.php b/core/helpers/module.php index eddac2f0..bc786fad 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -48,10 +48,18 @@ class module_Core { } public static function is_installed($module_name) { + if (!self::_core_installed()) { + return false; + } + return ORM::factory("module")->where("name", $module_name)->find()->loaded; } public static function installed() { + if (!self::_core_installed()) { + return array(); + } + return ORM::factory("module")->find_all(); } @@ -77,9 +85,7 @@ class module_Core { } public static function load_modules() { - // Lightweight hack to make sure that we've got a real install. - // @todo replace this when we have a better way of detecting that the core is installed - if (Kohana::config('database.default.connection.pass') == 'p@ssw0rd') { + if (!self::_core_installed()) { return array(); } @@ -118,4 +124,15 @@ class module_Core { $var->value = $value; $var->save(); } + + /** + * Lightweight hack to make sure that we've got a real install. + * + * @todo remove this when we have a real installer. + */ + private static function _core_installed() { + if (Kohana::config('database.default.connection.pass') == 'p@ssw0rd') { + return array(); + } + } } |