aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-24 15:19:28 -0800
committerredmatrix <git@macgirvin.com>2016-02-24 15:19:28 -0800
commit7e6febe2a6609457eca1f1caf650375534780048 (patch)
tree96f1715d8e72f69db0c7c32c646cb0a54aafb565 /include/plugin.php
parentb101a8f6fb3fd3ec0d5466ba1bb7bc9dc9480fba (diff)
downloadvolse-hubzilla-7e6febe2a6609457eca1f1caf650375534780048.tar.gz
volse-hubzilla-7e6febe2a6609457eca1f1caf650375534780048.tar.bz2
volse-hubzilla-7e6febe2a6609457eca1f1caf650375534780048.zip
add 'requires' field to plugin info to list other dependent plugins/addons and disable if dependencies are not installed/enabled
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-xinclude/plugin.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 5afded542..bd844442f 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -325,7 +325,8 @@ function get_plugin_info($plugin){
'description' => '',
'author' => array(),
'maintainer' => array(),
- 'version' => ''
+ 'version' => '',
+ 'requires' => ''
);
if (!is_file("addon/$plugin/$plugin.php"))
@@ -383,6 +384,22 @@ function check_plugin_versions($info) {
}
}
+ if(array_key_exists('requires',$info)) {
+ $arr = explode(',',$info['requires']);
+ $found = true;
+ if($arr) {
+ foreach($arr as $test) {
+ $test = trim($test);
+ if(! $test)
+ continue;
+ if(! in_array($test,get_app()->plugins))
+ $found = false;
+ }
+ }
+ if(! $found)
+ return false;
+ }
+
return true;
}