From 639b998d482242b3f72c0616f6c8ae285cd72085 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 19 Feb 2009 14:07:59 +0000 Subject: 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 --- engine/lib/plugins.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'engine/lib') 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 @@ -324,6 +324,27 @@ return false; } + /** + * 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. * -- cgit v1.2.3