summaryrefslogtreecommitdiff
path: root/core/helpers/module.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-12 01:22:03 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-12 01:22:03 +0000
commit35067cbced6dadbc4cb7e7a45334485320eb473b (patch)
treebf98fba45887c0fc18040b83d76ca67d6a68e5fe /core/helpers/module.php
parent63f6e037a7f7e53d40ac17f8a1adc5dc5fb378b7 (diff)
Expand on our core-is-installed checking code.
Diffstat (limited to 'core/helpers/module.php')
-rw-r--r--core/helpers/module.php23
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();
+ }
+ }
}