Bläddra i källkod

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 3 år sedan
förälder
incheckning
f448baed0a
1 ändrade filer med 7 tillägg och 1 borttagningar
  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