From a244fec29a2ebafd3590f371a69f4d319c6826be Mon Sep 17 00:00:00 2001 From: dimti Date: Tue, 19 Dec 2023 17:31:02 +0300 Subject: [PATCH] + support with profiler option for xdebug3 --- dockerfiles/php-fpm/xdebug3/xdebug.ini | 1 + dockerfiles/php-fpm/xdebug3/xdebug.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dockerfiles/php-fpm/xdebug3/xdebug.ini b/dockerfiles/php-fpm/xdebug3/xdebug.ini index 58131ae..3570bd8 100644 --- a/dockerfiles/php-fpm/xdebug3/xdebug.ini +++ b/dockerfiles/php-fpm/xdebug3/xdebug.ini @@ -1,3 +1,4 @@ xdebug.mode=off xdebug.discover_client_host=1 xdebug.start_with_request=yes +xdebug.output_dir=/tmp/profiler diff --git a/dockerfiles/php-fpm/xdebug3/xdebug.sh b/dockerfiles/php-fpm/xdebug3/xdebug.sh index de3d0fc..3f0349c 100755 --- a/dockerfiles/php-fpm/xdebug3/xdebug.sh +++ b/dockerfiles/php-fpm/xdebug3/xdebug.sh @@ -31,7 +31,14 @@ xdebug_start () # And uncomment line with xdebug extension, thus enabling it ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" - MODE_DEBUG_CMD="sed -i 's/^xdebug.mode.*/xdebug.mode=debug/g' /usr/local/etc/php/conf.d/xdebug.ini" + + if [[ -n "${WITH_PROFILER}" ]]; then + XDEBUG_MODE='profile' + else + XDEBUG_MODE='debug' + fi + + MODE_DEBUG_CMD="sed -i 's/^xdebug.mode.*/xdebug.mode=${XDEBUG_MODE}/g' /usr/local/etc/php/conf.d/xdebug.ini" docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${MODE_DEBUG_CMD}"