Explorar o código

Support XDebug 3 on bin/n98-magerun2

I struggled to use XDebug 3 to debug a sys:cron:run job I've created.
The `bin/xdebug enable` was not enough.
This would do the trick (solve the problem) when combined to environment > PHP_IDE_CONFIG at docker-compose.dev.yml and the correct configuration in phpstorm
Ricardo Martins %!s(int64=3) %!d(string=hai) anos
pai
achega
f448baed0a
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      compose/bin/n98-magerun2

+ 7 - 1
compose/bin/n98-magerun2

@@ -11,4 +11,10 @@ if ! bin/cliq ls bin/n98-magerun2.phar; then
   bin/cliq mv n98-magerun2.phar bin
 fi
 
-bin/cli bin/n98-magerun2.phar "$@"
+S=$(bin/cli cat /usr/local/etc/php/php.ini | grep -iGc 'xdebug.mode = off');
+
+if [[ $S == 1 ]]; then
+  bin/cli bin/n98-magerun2.phar "$@"
+else
+  bin/cli php -dxdebug.mode=debug -dxdebug.start_with_request=yes bin/n98-magerun2.phar "$@"
+fi