aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 14:07:59 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 14:07:59 +0000
commit639b998d482242b3f72c0616f6c8ae285cd72085 (patch)
tree96a030f34381685b88dfbd1048d655a53b50ffa9 /engine/lib
parent6fa9ce77c2efaabe0ec983ab62cbafdc9bc5c796 (diff)
downloadelgg-639b998d482242b3f72c0616f6c8ae285cd72085.tar.gz
elgg-639b998d482242b3f72c0616f6c8ae285cd72085.tar.bz2
Closes #394: May now specify elgg_version in the manifest to specify a minimum version of elgg required.
git-svn-id: https://code.elgg.org/elgg/trunk@2811 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/plugins.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 51d004b7a..abbeeccc5 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -325,6 +325,27 @@
}
/**
+ * This function checks a plugin manifest 'elgg_version' value against the current install
+ * returning TRUE if the elgg_version is <= the current install's version.
+ * @param $manifest_elgg_version_string The build version (eg 2009010201).
+ * @return bool
+ */
+ function check_plugin_compatibility($manifest_elgg_version_string)
+ {
+ $version = get_version();
+
+ if (strpos($manifest_elgg_version_string, '.')===false)
+ {
+ // Using version
+ $req_version = (int)$manifest_elgg_version_string;
+
+ return ($version >= $req_version);
+ }
+
+ return false;
+ }
+
+ /**
* Shorthand function for finding the plugin settings.
*
* @param string $plugin_name Optional plugin name, if not specified then it is detected from where you