From 65c9b61c5198e431c96fa7e894911326c4f87ed1 Mon Sep 17 00:00:00 2001 From: dimti Date: Thu, 16 Jan 2025 08:59:41 +0300 Subject: [PATCH] * force to restart php fpm container after turn on / off xdebug --- bash/xdebug-quit.sh | 2 ++ bash/xdebug-start.sh | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bash/xdebug-quit.sh b/bash/xdebug-quit.sh index 119286b..4a1465c 100755 --- a/bash/xdebug-quit.sh +++ b/bash/xdebug-quit.sh @@ -41,3 +41,5 @@ fi docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${PHP_FPM_XDEBUG_CONFIG_PATH}" docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${WORKSPACE_XDEBUG_CONFIG_PATH}" + +docker restart "${PHP_FPM_CONTAINER}" diff --git a/bash/xdebug-start.sh b/bash/xdebug-start.sh index 2cdcbd9..697dc0c 100755 --- a/bash/xdebug-start.sh +++ b/bash/xdebug-start.sh @@ -37,7 +37,7 @@ docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${WORKSPACE_X echo "Turn on xdebug: $PHP_VERSION" if [ -n "${WITH_PROFILER}" ]; then - echo "Profiler enabled" + echo "Profiler enabled" if [ "${PHP_VERSION}" = 74 ]; then SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.profiler_enable=.*/xdebug.profiler_enable=1/g'" else @@ -51,3 +51,8 @@ if [ -n "${SED_DEBUG_OR_PROFILER_MODE_ON}" ]; then docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${PHP_FPM_XDEBUG_CONFIG_PATH}" docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${WORKSPACE_XDEBUG_CONFIG_PATH}" fi + +docker restart "${PHP_FPM_CONTAINER}" + +echo 'Use this for resolve hostname in your IDE debugger:' +echo 'export PHP_IDE_CONFIG="serverName=myproject.cli.local.wpstudio.ru"'