From 9436bad8c185aa6255268311136ed00bb44c737b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 7 Nov 2012 19:39:30 +0000 Subject: [PATCH] isExtensionOlder() is no longer required --- inc/extensions-functions.php | 12 ------------ inc/wrapper-functions.php | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 013babf309..c5f03b2097 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -996,18 +996,6 @@ function doDeactivateExtension ($ext_name, $inRebuild = FALSE) { ); } -// Checks whether the extension is older than given -function isExtensionOlder ($ext_name, $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 - - // Return cache - return $GLOBALS[__FUNCTION__][$ext_name][$ext_ver]; -} - // Creates a new task for updated extension function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) { // Create subject line diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 3cb8113529..c8b651cf21 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -776,7 +776,7 @@ function isExtensionInstalledAndOlder ($ext_name, $ext_ver) { // Is an cache entry found? if (!isset($GLOBALS[__FUNCTION__][$ext_name][$ext_ver])) { // Determine it - $GLOBALS[__FUNCTION__][$ext_name][$ext_ver] = ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $ext_ver))); + $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); -- 2.39.5