Merge pull request #2797 from jonpage999/force-workspace-xdebug-v2

Force xDebug v2 for workspace
This commit is contained in:
Shao Yu-Lung (Allen) 2020-12-16 22:39:43 +08:00 committed by GitHub
commit db506353ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 3 deletions

View File

@ -350,9 +350,26 @@ USER root
ARG INSTALL_XDEBUG=false ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands # Install the xdebug extension
apt-get install -y php${LARADOCK_PHP_VERSION}-xdebug && \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
sed -i 's/^;//g' /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-xdebug.ini \ 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 ;fi
# ADD for REMOTE debugging # ADD for REMOTE debugging