From c6f4910a3de99b24cc73342f37598fe28fa3fa07 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 49dc066..5db7e94 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, PCov, Redis, Solr, timezonedb, uuid, XMLRPC (beta) -pecl install apcu igbinary memcached pcov redis solr timezonedb uuid xmlrpc-beta -docker-php-ext-enable apcu igbinary memcached pcov redis solr timezonedb uuid xmlrpc +pecl install apcu igbinary memcached pcov solr timezonedb uuid xmlrpc-beta +docker-php-ext-enable apcu igbinary memcached 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 56f85e1..e2411ff 100644 --- a/tests/fixtures/test.php +++ b/tests/fixtures/test.php @@ -41,6 +41,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";