Browse Source

- remove winpty things

master
dimti 3 years ago
parent
commit
ea0ee2c28a
  1. 42
      dockerfiles/php-fpm/xdebug.sh

42
dockerfiles/php-fpm/xdebug.sh

@ -17,26 +17,11 @@ if [[ ! -z "${WITH_PROFILER}" ]]; then
echo "With profiler option". echo "With profiler option".
fi fi
# Grab OS type
if [[ "$(uname)" == "Darwin" ]]; then
OS_TYPE="OSX"
else
OS_TYPE=$(expr substr $(uname -s) 1 5)
fi
xdebug_status () xdebug_status ()
{ {
echo 'xDebug status' echo 'xDebug status'
# If running on Windows, need to prepend with winpty :(
if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi
} }
@ -50,18 +35,6 @@ xdebug_start ()
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=0/xdebug.remote_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini" REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=0/xdebug.remote_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_ENABLE_CDM="sed -i 's/^xdebug.profiler_enable=0/xdebug.profiler_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini" PROFILER_ENABLE_CDM="sed -i 's/^xdebug.profiler_enable=0/xdebug.profiler_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
# If running on Windows, need to prepend with winpty :(
if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
if [[ ! -z "${WITH_PROFILER}" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}"
fi
else
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
@ -71,7 +44,6 @@ xdebug_start ()
if [[ ! -z "${WITH_PROFILER}" ]]; then if [[ ! -z "${WITH_PROFILER}" ]]; then
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}" docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}"
fi fi
fi
} }
@ -85,19 +57,6 @@ xdebug_stop ()
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=1/xdebug.remote_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini" REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=1/xdebug.remote_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_DISABLE_CMD="sed -i 's/^xdebug.profiler_enable=1/xdebug.profiler_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini" PROFILER_DISABLE_CMD="sed -i 's/^xdebug.profiler_enable=1/xdebug.profiler_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
# If running on Windows, need to prepend with winpty :(
if [[ $OS_TYPE == "MINGW" ]]; then
# This is the equivalent of:
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
docker restart $PHP_FPM_CONTAINER
#docker-compose restart php-fpm
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}"
else
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
@ -105,7 +64,6 @@ xdebug_stop ()
docker restart $PHP_FPM_CONTAINER docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}"
fi
} }

Loading…
Cancel
Save