// 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
} // END - if
// Shall we remove? (default, not while just showing an extension removal)
- if ($isDryRun === FALSE) {
+ if (($isDryRun === FALSE) && (isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction]))) {
// Mark for filter removal
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!');
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
}
// Wrapper function for checking if extension is installed and newer or same version
-function isExtensionInstalledAndNewer ($ext_name, $version) {
+function isExtensionInstalledAndNewer ($ext_name, $ext_ver) {
// Is an cache entry found?
- if (!isset($GLOBALS[__FUNCTION__][$ext_name][$version])) {
+ if (!isset($GLOBALS[__FUNCTION__][$ext_name][$ext_ver])) {
// Determine it
- $GLOBALS[__FUNCTION__][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+ $GLOBALS[__FUNCTION__][$ext_name][$ext_ver] = ((isExtensionInstalled($ext_name)) && (version_compare(getExtensionVersion($ext_name), $ext_ver, '>=') === TRUE));
} else {
// Cache hits should be incremented twice
incrementStatsEntry('cache_hits', 2);
}
// Return it
- //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '=>' . $version . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
- return $GLOBALS[__FUNCTION__][$ext_name][$version];
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '=>' . $ext_ver . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$ext_ver]));
+ return $GLOBALS[__FUNCTION__][$ext_name][$ext_ver];
}
// Wrapper function for checking if extension is installed and older than given version
-function isExtensionInstalledAndOlder ($ext_name, $version) {
+function isExtensionInstalledAndOlder ($ext_name, $ext_ver) {
// Is an cache entry found?
- if (!isset($GLOBALS[__FUNCTION__][$ext_name][$version])) {
+ if (!isset($GLOBALS[__FUNCTION__][$ext_name][$ext_ver])) {
// Determine it
- $GLOBALS[__FUNCTION__][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+ $GLOBALS[__FUNCTION__][$ext_name][$ext_ver] = ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $ext_ver)));
} else {
// Cache hits should be incremented twice
incrementStatsEntry('cache_hits', 2);
}
// Return it
- //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '<' . $version . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
- return $GLOBALS[__FUNCTION__][$ext_name][$version];
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '<' . $ext_ver . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$ext_ver]));
+ return $GLOBALS[__FUNCTION__][$ext_name][$ext_ver];
}
// Set username