[Pkg-owncloud-commits] [owncloud] 264/457: Check for redis to be 2.2.5+

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit bdc82dcfb900050f66d7e632c2808363b57e8a96
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Tue Jun 2 15:03:27 2015 +0200

    Check for redis to be 2.2.5+
---
 lib/private/memcache/redis.php |  3 ++-
 settings/admin.php             | 19 +++++++++++++++----
 settings/templates/admin.php   |  6 +++---
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/lib/private/memcache/redis.php b/lib/private/memcache/redis.php
index 78d0614..cfc35dc 100644
--- a/lib/private/memcache/redis.php
+++ b/lib/private/memcache/redis.php
@@ -151,7 +151,8 @@ class Redis extends Cache implements IMemcache {
 	}
 
 	static public function isAvailable() {
-		return extension_loaded('redis');
+		return extension_loaded('redis')
+			&& version_compare(phpversion('redis'), '2.2.5', '>=');
 	}
 }
 
diff --git a/settings/admin.php b/settings/admin.php
index f2e01ad..ee252ce 100644
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -35,6 +35,7 @@ OC_Util::checkAdminUser();
 OC_App::setActiveNavigationEntry("admin");
 
 $template = new OC_Template('settings', 'admin', 'user');
+$l = OC_L10N::get('settings');
 
 $showLog = (\OC::$server->getConfig()->getSystemValue('log_type', 'owncloud') === 'owncloud');
 $numEntriesToLoad = 3;
@@ -128,13 +129,23 @@ $template->assign('getenvServerNotWorking', empty($path));
 // warn if Windows is used
 $template->assign('WindowsWarning', OC_Util::runningOnWindows());
 
-// warn if outdated version of APCu is used
-$template->assign('ApcuOutdatedWarning',
-	extension_loaded('apcu') && version_compare(phpversion('apc'), '4.0.6') === -1);
+// warn if outdated version of a memcache module is used
+$caches = [
+	'apcu'	=> ['name' => $l->t('APCu'), 'version' => '4.0.6'],
+	'redis'	=> ['name' => $l->t('Redis'), 'version' => '2.2.5'],
+];
+
+$outdatedCaches = [];
+foreach ($caches as $php_module => $data) {
+	$isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
+	if ($isOutdated) {
+		$outdatedCaches[$php_module] = $data;
+	}
+}
+$template->assign('OutdatedCacheWarning', $outdatedCaches);
 
 // add hardcoded forms from the template
 $forms = OC_App::getForms('admin');
-$l = OC_L10N::get('settings');
 $formsAndMore = array();
 if ($request->getServerProtocol()  !== 'https' || !OC_Util::isAnnotationsWorking() ||
 	$suggestedOverwriteCliUrl || !OC_Util::isSetLocaleWorking()  ||
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 3d253d4..fb6ef9b 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -106,11 +106,11 @@ if ($_['WindowsWarning']) {
 <?php
 }
 
-// APCU Warning if outdated
-if ($_['ApcuOutdatedWarning']) {
+// Warning if memcache is outdated
+foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
 	?>
 	<li>
-		<?php p($l->t('APCu below version 4.0.6 is installed, for stability and performance reasons we recommend to update to a newer APCu version.')); ?>
+		<?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons we recommend to update to a newer %1$s version.', $data)); ?>
 	</li>
 <?php
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list