aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-14 18:14:30 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-14 18:14:30 +0100
commit72353bf0446901f1711cba7a2e50dbce9bd06227 (patch)
tree6b73f79bf7386e69e4941ff5a8b4c165830b1652 /include/plugin.php
parent42433c0b4442f1a6b451324fe7f765b1b4c354b8 (diff)
parent9f9fdc1434b7283171f8d843f225228cdb322115 (diff)
downloadvolse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.tar.gz
volse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.tar.bz2
volse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-xinclude/plugin.php37
1 files changed, 32 insertions, 5 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 4da73dfd8..2bc363556 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -348,19 +348,46 @@ function get_plugin_info($plugin){
} else {
$info[$k][] = array('name' => $v);
}
- } else {
-// if (array_key_exists($k, $info)){
- $info[$k] = $v;
-// }
+ }
+ else {
+ $info[$k] = $v;
}
}
}
}
-
return $info;
}
+function check_plugin_versions($info) {
+
+ if(! is_array($info))
+ return true;
+
+ if(array_key_exists('minversion',$info)) {
+ if(version_compare(trim($info['minversion']),STD_VERSION, '>=')) {
+ logger('minversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING);
+ return false;
+ }
+ }
+ if(array_key_exists('maxversion',$info)) {
+ if(version_compare(STD_VERSION,trim($info['maxversion']), '>')) {
+ logger('maxversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING);
+ return false;
+ }
+ }
+ if(array_key_exists('minphpversion',$info)) {
+ if(version_compare(trim($info['minphpversion']),PHP_VERSION, '>=')) {
+ logger('minphpversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
/**
* @brief Parse theme comment in search of theme infos.