Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable22] Fix check for redis minimal version #28954

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/private/RedisFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace OC;

class RedisFactory {
public const REDIS_MINIMAL_VERSION = '2.2.5';
public const REDIS_MINIMAL_VERSION = '3.1.3';
public const REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION = '5.3.0';

/** @var \Redis|\RedisCluster */
Expand Down Expand Up @@ -139,8 +139,8 @@ private function create() {
/**
* Get the ssl context config
*
* @param Array $config the current config
* @return Array|null
* @param array $config the current config
* @return array|null
* @throws \UnexpectedValueException
*/
private function getSslContext($config) {
Expand All @@ -167,9 +167,9 @@ public function getInstance() {
return $this->instance;
}

public function isAvailable() {
return extension_loaded('redis')
&& version_compare(phpversion('redis'), '2.2.5', '>=');
public function isAvailable(): bool {
return \extension_loaded('redis') &&
\version_compare(\phpversion('redis'), self::REDIS_MINIMAL_VERSION, '>=');
}

/**
Expand Down