|
@ -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' |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -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 :( |
|
|
|
|
|
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 "${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 |
|
|
|
|
|
|
|
|
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 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -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 :( |
|
|
|
|
|
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 "${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 |
|
|
|
|
|
|
|
|
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}" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|