mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-66139 cachestore_redis: Fix connection problems when port is not set
Due to some changes in Redis 5 php extension Moodle fails to connect via TCP when no port is set. It's fixed upstream in phpredis repo (version 5.0.0, 5.0.1 and 5.0.2 affected so far), but with this patch we'll send the right port anyway.
This commit is contained in:
parent
0dca957716
commit
d17bf23e8a
3
cache/stores/redis/lib.php
vendored
3
cache/stores/redis/lib.php
vendored
@ -150,7 +150,8 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_
|
||||
*/
|
||||
protected function new_redis($server, $prefix = '', $password = '') {
|
||||
$redis = new Redis();
|
||||
$port = null;
|
||||
// Check if it isn't a Unix socket to set default port.
|
||||
$port = ($server[0] === '/') ? null : 6379;
|
||||
if (strpos($server, ':')) {
|
||||
$serverconf = explode(':', $server);
|
||||
$server = $serverconf[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user