humanmade / platform_chassis_extension

Meta-extension for Platform requirements
0 stars 4 forks source link

Include Xdebug #2

Open johnbillion opened 5 years ago

johnbillion commented 5 years ago

The Xdebug extension is handy for a few reasons. It makes debugging output prettier (for those who enjoy using var_dump(), it provides full stack traces for fatal errors, and it allows breakpoint debugging via your favourite client.

It also works with PHP 7.3 now.

Chassis/Xdebug

roborourke commented 5 years ago

I know we include phpdbg right now, @rmccue would be good to document how to use phpdbg. I don't think many of us in HM are anywhere near as familiar with it as XDebug.

rmccue commented 5 years ago

@roborourke Indeed; the problem is broader, and phpdbg itself has poor documentation. I've been working on it at https://rmccue.github.io/phpdbg-docs/

roborourke commented 5 years ago

So this comment from one of the phpdbg maintainers is pretty revealing: https://www.reddit.com/r/PHP/comments/5zmis5/is_phpdbg_dead/dezvk43/

Key highlights:

When phpdbg became part of PHP, many people expressed interest in being able to use phpdbg from their IDE. What we should have said is "no, use xdebug": xdebug is mature software, full of features, with excellent remote capabilities.

phpdbg has some extremely powerful features that do not fit into DBGp (we later learned that DBGp could have been extended), and because of the architecture of the software is not really suitable for debugging your Apache or FPM process

As it's a command line debugger it doesn't really make sense for the majority of the work we do or that anyone working on Altis would do. XDebug is way more useful, has much better knowledge share at least internally, better documentation, is already widely used and much better integrated with other tools.

phpdbg is not a replacement for XDebug so I think we should provide it in our dev environments, I'm pretty sure 9/10 times a dev is gonna have to install it anyway.

rmccue commented 5 years ago

I'm OK with that, my reservations are two-fold though:

  1. I want to make sure we're sticking to quite a minimal set of things installed where possible. We made a conscious with Chassis to stick to a smaller set of tools, as there's lots of dev environments that include all sorts of stuff out of the box (phpMyAdmin, etc). I still think that's the right choice here too, and we should carefully consider what tools we include.
  2. XDebug isn't used by everyone, and actively makes my development environment worse out-of-the-box. If it purely provided interactive debugging, I'd be 100% on-board, but it also messes with error reporting, var_dump, and ruins performance in some cases.

If we can disable the other stuff, then I'm OK with bundling it, as there are a decent amount of people who use it. I would still suggest that installing it globally is a better idea though, as a dev tool.

(Also, I actually don't necessarily think we should bundle phpdbg.)

roborourke commented 5 years ago

We could document how to add it as a global extension then, and remove phpdbg at the same time.

kadamwhite commented 5 years ago

If you install XDebug globally, how do you specify the IDE config property?

roborourke commented 5 years ago

I’m not sure you need to. Or at least I’ve never changed it from whatever default we put in that extension. Do you normally override that setting?