- remove winpty things

This commit is contained in:
2021-10-11 18:00:50 +03:00
parent d6b28eeb74
commit ea0ee2c28a

View File

@ -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 :( docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
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'
fi
} }
@ -50,27 +35,14 @@ 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 :( docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
if [[ $OS_TYPE == "MINGW" ]]; then docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}" docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
if [[ ! -z "${WITH_PROFILER}" ]]; then if [[ ! -z "${WITH_PROFILER}" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}" 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 "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
if [[ ! -z "${WITH_PROFILER}" ]]; then
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}"
fi
fi fi
} }
@ -85,27 +57,13 @@ 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 :( docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
if [[ $OS_TYPE == "MINGW" ]]; then docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
# This is the equivalent of: docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla' # docker-compose restart php-fpm
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593 docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}" docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_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 "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
# docker-compose restart php-fpm
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}"
fi
} }