From 6743629602520c91546f5e19f0cd09add7a7982c Mon Sep 17 00:00:00 2001 From: dimti Date: Thu, 3 Feb 2022 19:10:36 +0300 Subject: [PATCH] * xdebug in workspace downgrading to 2.x version * with profiler option in xdebug workspace starter script --- dockerfiles/workspace/xdebug.sh | 5 +++++ src/dockerfiles/workspace/workspace.base.Dockerfile | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dockerfiles/workspace/xdebug.sh b/dockerfiles/workspace/xdebug.sh index d2ccc59..630906e 100755 --- a/dockerfiles/workspace/xdebug.sh +++ b/dockerfiles/workspace/xdebug.sh @@ -3,6 +3,7 @@ # NOTE: At the moment, this has only been confirmed to work with PHP 7 PHP_VERSION=$2 # Without dot +WITH_PROFILER=$3 # Grab full name of workspace container WORKSPACE_CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}') @@ -12,6 +13,10 @@ if [[ -z "${WORKSPACE_CONTAINER}" ]]; then exit 1 fi +if [[ ! -z "${WITH_PROFILER}" ]]; then + echo "With profiler option". +fi + xdebug_status () { echo 'xDebug status' diff --git a/src/dockerfiles/workspace/workspace.base.Dockerfile b/src/dockerfiles/workspace/workspace.base.Dockerfile index dae9c41..5c0abfd 100644 --- a/src/dockerfiles/workspace/workspace.base.Dockerfile +++ b/src/dockerfiles/workspace/workspace.base.Dockerfile @@ -176,9 +176,8 @@ COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ - # Load the xdebug extension only with phpunit commands - apt-get install -y php${PHP_VERSION}-xdebug && \ - sed -i 's/^zend_extension=/;zend_extension=/g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ + pecl install xdebug-2.8.1 && \ + echo ';zend_extension=xdebug.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ ;fi