summaryrefslogtreecommitdiffstats
path: root/inc/module.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-13 18:24:08 +0200
committerSimon Rettberg2016-05-13 18:24:08 +0200
commit7d916647e1b82fcc8a17b68d3ae0615af42f53e0 (patch)
treeda83387a203c3b25980c4a5068418862c2b6a0a9 /inc/module.inc.php
parentStill working in modularization cleanup and refinement (diff)
downloadslx-admin-7d916647e1b82fcc8a17b68d3ae0615af42f53e0.tar.gz
slx-admin-7d916647e1b82fcc8a17b68d3ae0615af42f53e0.tar.xz
slx-admin-7d916647e1b82fcc8a17b68d3ae0615af42f53e0.zip
Get baseconfig ready for modularization
Diffstat (limited to 'inc/module.inc.php')
-rw-r--r--inc/module.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/inc/module.inc.php b/inc/module.inc.php
index 894bc0f6..246505b5 100644
--- a/inc/module.inc.php
+++ b/inc/module.inc.php
@@ -19,6 +19,23 @@ class Module
return false;
return self::$modules[$name];
}
+
+ /**
+ * Check whether given module is available, that is, all dependencies are
+ * met. If the module is available, it will be activated, so all it's classes
+ * are available through the auto-loader.
+ *
+ * @param string $moduleId module to check
+ * @return bool true if module is available and activated
+ */
+ public static function isAvailable($moduleId)
+ {
+ $module = self::get($moduleId);
+ if ($module === false)
+ return false;
+ $module->activate();
+ return !$module->hasMissingDependencies();
+ }
private static function resolveDepsByName($name)
{