From 6e281d7acd1c67715fbb6ad6f2d91454c7a6c78f Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 7 Dec 2023 12:12:29 +1300 Subject: [PATCH] FIX Remove preinstalled psr extension --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 985a9cf..7b24a00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,6 +210,17 @@ jobs: if [[ "${{ matrix.phpcoverage }}" != "true" ]]; then sudo sh -c "echo ';zend_extension=xdebug.so' > /etc/php/${{ matrix.php }}/mods-available/xdebug.ini" fi + + # Remove php8.x-psr extension which may be pre-installed with ubuntu + # The extension adds a PHP PsrExt namespace aliased to Psr and the implementation of + # PsrExt\Log\LoggerInterface::emergency() has a signature that conflicts with Monolog\Logger::emergency() + match=$(sudo dpkg --get-selections | grep php | grep psr) || true + if [[ "$match" =~ ^(php[0-9\.]+\-psr) ]]; then + extension=${BASH_REMATCH[1]}; + sudo apt remove "$extension" + echo "Removed PHP extension $extension" + fi + echo "PHP has been configured" - name: Install additional requirements