// Checks whether the extension is older than given
function isExtensionOlder ($ext_name, $ext_ver) {
- // Get current extension version
- $currVersion = getExtensionVersion($ext_name);
-
- // Remove all dots from both versions
- $currVersion = str_replace('.', '', $currVersion);
- $ext_ver = str_replace('.', '', $ext_ver);
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__][$ext_name][$ext_ver])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__][$ext_name][$ext_ver] = (version_compare(getExtensionVersion($ext_name), $ext_ver, '<') === TRUE);
+ } // END - if
- // Now compare both and return the result
- return ($currVersion < $ext_ver);
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$ext_name][$ext_ver];
}
// Creates a new task for updated extension