Local-bootstrap.php is triggering a breakpoint when XDebug is enabled

I created an account just to say this:

Please revert defining WP_ENVIRONMENT_TYPE. Here are my reasons:

  • As already said by @hereswhatidid, the default option in PhpStorm is to force break when a script is outside of the project. This means that all Local users have to uncheck this option on all their projects. This is not an option IMHO.
  • Having a local-bootstrap.php set as auto_prepend_file will cause the file name in PhpStorms “Debug” dock to always read local-bootstrap.php, regardless of the actual file the breakpoint is in. See this screenshot:
  • It is not possible to quickly switch environments from e.g. development to production for testing purposes if you have a Composer-based setup with WP Starter (which sets multiple constants based on the environment type), because WP_ENVIRONMENT_TYPE will always be set to local.

If you don’t remove this, please make it at least an option (and inactive by default).
Thanks!

BTW, if others wants to to get rid of this, simply comment out the define( 'WP_ENVIRONMENT_TYPE', 'local' ); in /Applications/Local.app/Contents/Resources/extraResources/local-bootstrap.php.

2 Likes