浏览代码

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 年之前
父节点
当前提交
f448baed0a
共有 1 个文件被更改,包括 7 次插入1 次删除
  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