From 900fed5c448cca6de94cd43ebe3fc998671a3590 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 17 Nov 2023 17:37:46 +0100 Subject: [PATCH] Enable igbinary serializer for redis It comes disabled by default and Moodle does support to use it as alternative serializer. Covered with test. --- root/tmp/setup/php-extensions.sh | 8 ++++++-- tests/fixtures/test.php | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/root/tmp/setup/php-extensions.sh b/root/tmp/setup/php-extensions.sh index ff60031..9e1c3dc 100755 --- a/root/tmp/setup/php-extensions.sh +++ b/root/tmp/setup/php-extensions.sh @@ -58,11 +58,15 @@ docker-php-ext-configure ldap docker-php-ext-install -j$(nproc) ldap # APCu, igbinary, Memcached, MongoDB, PCov, Redis, Solr, timezonedb, uuid, XMLRPC (beta) -pecl install apcu igbinary memcached mongodb pcov redis solr timezonedb uuid xmlrpc-beta -docker-php-ext-enable apcu igbinary memcached mongodb pcov redis solr timezonedb uuid xmlrpc +pecl install apcu igbinary memcached mongodb pcov solr timezonedb uuid xmlrpc-beta +docker-php-ext-enable apcu igbinary memcached mongodb pcov solr timezonedb uuid xmlrpc echo 'apc.enable_cli = On' >> /usr/local/etc/php/conf.d/10-docker-php-ext-apcu.ini +# Install the redis extension enabling igbinary support. +pecl install --configureoptions 'enable-redis-igbinary="yes"' redis +docker-php-ext-enable redis + # Install, but do not enable, xdebug and xhprof. pecl install xdebug xhprof diff --git a/tests/fixtures/test.php b/tests/fixtures/test.php index 8465970..d8845a3 100644 --- a/tests/fixtures/test.php +++ b/tests/fixtures/test.php @@ -42,6 +42,10 @@ } setlocale(LC_TIME, 'en_AU.UTF-8'); +if (!defined('\Redis::SERIALIZER_IGBINARY')) { + $missing[] = 'redis support for igbinary serializer'; +} + if (php_sapi_name() === 'cli') { if (empty($missing)) { echo "OK\n";