mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-57572 redis: Prevent installation to fail on sites without redis
This commit is contained in:
parent
7bdbad80d8
commit
e238dcc8b2
27
cache/stores/redis/settings.php
vendored
27
cache/stores/redis/settings.php
vendored
@ -35,17 +35,20 @@ $settings->add(
|
||||
)
|
||||
);
|
||||
|
||||
$options = array(Redis::SERIALIZER_PHP => get_string('serializer_php', 'cachestore_redis'));
|
||||
if (class_exists('Redis')) { // Only if Redis is available.
|
||||
|
||||
if (defined('Redis::SERIALIZER_IGBINARY')) {
|
||||
$options[Redis::SERIALIZER_IGBINARY] = get_string('serializer_igbinary', 'cachestore_redis');
|
||||
$options = array(Redis::SERIALIZER_PHP => get_string('serializer_php', 'cachestore_redis'));
|
||||
|
||||
if (defined('Redis::SERIALIZER_IGBINARY')) {
|
||||
$options[Redis::SERIALIZER_IGBINARY] = get_string('serializer_igbinary', 'cachestore_redis');
|
||||
}
|
||||
|
||||
$settings->add(new admin_setting_configselect(
|
||||
'cachestore_redis/test_serializer',
|
||||
get_string('test_serializer', 'cachestore_redis'),
|
||||
get_string('test_serializer_desc', 'cachestore_redis'),
|
||||
0,
|
||||
$options
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$settings->add(new admin_setting_configselect(
|
||||
'cachestore_redis/test_serializer',
|
||||
get_string('test_serializer', 'cachestore_redis'),
|
||||
get_string('test_serializer_desc', 'cachestore_redis'),
|
||||
0,
|
||||
$options
|
||||
)
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user