-
Notifications
You must be signed in to change notification settings - Fork 545
Extend Xdebug note #1986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Xdebug note #1986
Conversation
If a problem is emitted proper DX says you should also suggest a solution.
staabm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like.
|
I like it too ! There's also this that might be an option : https://packagist.org/packages/composer/xdebug-handler |
its already used in phpstan, see Line 12 in 582a9cb
|
| $errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.'); | ||
| } elseif (!$allowXdebug && XdebugHandler::isXdebugActive()) { | ||
| $errorOutput->getStyle()->note('The Xdebug PHP extension is active, but "--xdebug" is not used. This may slow down performance and the process will not halt at breakpoints.'); | ||
| $errorOutput->getStyle()->note('The Xdebug PHP extension is active, but "--xdebug" is not used. This may slow down performance and the process will not halt at breakpoints. Run with XDEBUG_MODE=off to disable Xdebug and remove this message.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue that this message isn't still clear enough. What does "Run with XDEBUG_MODE=off" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's not totally clear, but phpstan is a developer tool, and to developers this is at least a firm push in the right direction. A better explanation would take at least 4 lines, likely more, and at that point I think you're crossing the line it should be explained thoroughly at https://phpstan.org/user-guide/command-line-usage, and the warning itself should just be as it is now.
If the verbose explanation is in the docs people who need it can and will google "phpstan xdebug_mode=off" and find it right away.
|
If phpstan/phpstan#8343 is merged we could link to https://phpstan.org/user-guide/command-line-usage#--xdebug in the note. (you may not want to add documentation permalinks to the sources, in that case the google argument still holds) |
|
I'm not really keen on this. It's not the only solution you can do, and the environment variable was introduced only pretty recently with Xdebug 3... Sorry, I decided no to merge this. |
If a problem is emitted proper DX says you should also suggest a solution.