From 78ba356e696344f9d7afac2f16afd1881e7dee59 Mon Sep 17 00:00:00 2001 From: Jonathon Page Date: Tue, 15 Dec 2020 15:38:23 +0000 Subject: [PATCH] Force xDebug v2 for workspace --- workspace/Dockerfile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 0043dd8..ee3e271 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -350,9 +350,26 @@ USER root ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ - # Load the xdebug extension only with phpunit commands - apt-get install -y php${LARADOCK_PHP_VERSION}-xdebug && \ - sed -i 's/^;//g' /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-xdebug.ini \ + # Install the xdebug extension + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install xdebug-2.5.5; \ + else \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install xdebug-2.9.0; \ + else \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \ + pecl install xdebug-2.9.8; \ + else \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \ + pecl install xdebug-2.9.8; \ + else \ + #pecl install xdebug; \ + echo "xDebug 3 required, not supported."; \ + fi \ + fi \ + fi \ + fi && \ + echo "zend_extension=xdebug.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-xdebug.ini \ ;fi # ADD for REMOTE debugging