diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-19 14:07:59 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-19 14:07:59 +0000 |
commit | 639b998d482242b3f72c0616f6c8ae285cd72085 (patch) | |
tree | 96a030f34381685b88dfbd1048d655a53b50ffa9 /engine | |
parent | 6fa9ce77c2efaabe0ec983ab62cbafdc9bc5c796 (diff) | |
download | elgg-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')
-rw-r--r-- | engine/lib/plugins.php | 21 |
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
|