Adjust test and examples according to Xdebug 3.0

This commit is contained in:
cytopia 2020-12-12 19:04:35 +01:00
parent 75aa5139e2
commit 09b8803f21
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
4 changed files with 23 additions and 26 deletions

View File

@ -60,18 +60,18 @@ fi
### Xdebug default disabled
###
printf "[TEST] Xdebug default disabled"
if [ "${PHP_VERSION}" = "8.0" ] || [ "${PHP_VERSION}" = "8.1" ]; then
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.mode' | grep -E 'develop.+develop' >/dev/null" "${RETRIES}" "" "0"; then
if [ "${PHP_VERSION}" = "5.2" ] || [ "${PHP_VERSION}" = "5.3" ] || [ "${PHP_VERSION}" = "5.4" ] || [ "${PHP_VERSION}" = "5.5" ] || [ "${PHP_VERSION}" = "5.6" ] || [ "${PHP_VERSION}" = "7.0" ] || [ "${PHP_VERSION}" = "7.1" ]; then
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.remote_enable' | grep -E 'Off.+Off' >/dev/null" "${RETRIES}" "" "0"; then
printf "\\r[FAIL] Xdebug default disabled\\n"
run "curl -sS 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.mode' || true"
run "curl -sS 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.remote_enable' || true"
exit 1
else
printf "\\r[OK] Xdebug default disabled\\n"
fi
else
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.remote_enable' | grep -E 'Off.+Off' >/dev/null" "${RETRIES}" "" "0"; then
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.mode' | grep -E 'develop.+develop' >/dev/null" "${RETRIES}" "" "0"; then
printf "\\r[FAIL] Xdebug default disabled\\n"
run "curl -sS 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.remote_enable' || true"
run "curl -sS 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.mode' || true"
exit 1
else
printf "\\r[OK] Xdebug default disabled\\n"
@ -82,15 +82,7 @@ fi
### Xdebug autostart disabled
###
printf "[TEST] Xdebug autostart disabled"
if [ "${PHP_VERSION}" = "8.0" ] || [ "${PHP_VERSION}" = "8.1" ]; then
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.start_with_request' | grep -E 'default.+default' >/dev/null" "${RETRIES}" "" "0"; then
printf "\\r[FAIL] Xdebug autostart disabled\\n"
run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.start_with_request' || true"
exit 1
else
printf "\\r[OK] Xdebug autostart disabled\\n"
fi
else
if [ "${PHP_VERSION}" = "5.2" ] || [ "${PHP_VERSION}" = "5.3" ] || [ "${PHP_VERSION}" = "5.4" ] || [ "${PHP_VERSION}" = "5.5" ] || [ "${PHP_VERSION}" = "5.6" ] || [ "${PHP_VERSION}" = "7.0" ] || [ "${PHP_VERSION}" = "7.1" ]; then
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.remote_autostart' | grep -E 'Off.+Off' >/dev/null" "${RETRIES}" "" "0"; then
printf "\\r[FAIL] Xdebug autostart disabled\\n"
run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.remote_autostart' || true"
@ -98,4 +90,12 @@ else
else
printf "\\r[OK] Xdebug autostart disabled\\n"
fi
else
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | tac | tac | grep 'xdebug.start_with_request' | grep -E 'default.+default' >/dev/null" "${RETRIES}" "" "0"; then
printf "\\r[FAIL] Xdebug autostart disabled\\n"
run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_php.php' | grep 'xdebug.start_with_request' || true"
exit 1
else
printf "\\r[OK] Xdebug autostart disabled\\n"
fi
fi

View File

@ -21,13 +21,12 @@
[PHP]
; Xdebug
; https://3.xdebug.org/docs/upgrade_guide
; Use these settings to enable Xdebug for PHP
; Make sure to read up on Xdebug some settings might significantly slow down requests.
; The following is just an example configuration and should be adjusted
xdebug.default_enable = On
xdebug.profiler_enable = On
xdebug.remote_enable = On
xdebug.remote_autostart = On
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_handler = dbgp
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM

View File

@ -21,13 +21,12 @@
[PHP]
; Xdebug
; https://3.xdebug.org/docs/upgrade_guide
; Use these settings to enable Xdebug for PHP
; Make sure to read up on Xdebug some settings might significantly slow down requests.
; The following is just an example configuration and should be adjusted
xdebug.default_enable = On
xdebug.profiler_enable = On
xdebug.remote_enable = On
xdebug.remote_autostart = On
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_handler = dbgp
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM

View File

@ -21,13 +21,12 @@
[PHP]
; Xdebug
; https://3.xdebug.org/docs/upgrade_guide
; Use these settings to enable Xdebug for PHP
; Make sure to read up on Xdebug some settings might significantly slow down requests.
; The following is just an example configuration and should be adjusted
xdebug.default_enable = On
xdebug.profiler_enable = On
xdebug.remote_enable = On
xdebug.remote_autostart = On
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_handler = dbgp
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM