From 97cf6f7aa470e36bd8c5f71e05ebdc27999b9698 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. Fixes #182 --- 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 60bdc69..590aeef 100755 --- a/root/tmp/setup/php-extensions.sh +++ b/root/tmp/setup/php-extensions.sh @@ -59,11 +59,15 @@ docker-php-ext-install -j$(nproc) ldap # APCu, igbinary, Memcached, PCov, Redis, Solr, timezonedb, uuid # Note: Missing as of 2023-06-17: solr -pecl install apcu igbinary memcached pcov redis timezonedb uuid -docker-php-ext-enable apcu igbinary memcached pcov redis timezonedb uuid +pecl install apcu igbinary memcached pcov timezonedb uuid +docker-php-ext-enable apcu igbinary memcached pcov timezonedb uuid 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 fda9369..242f867 100644 --- a/tests/fixtures/test.php +++ b/tests/fixtures/test.php @@ -40,6 +40,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";