WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.65k stars 261 forks source link

[CLI] Set debug constants during boot #1983

Closed bgrgicak closed 2 weeks ago

bgrgicak commented 2 weeks ago

This PR sets the WordPress debug constants during the CLI boot.

Depending on the --debug flag, WP_DEBUG, and WP_DEBUG_LOG will be set to true or false during boot. The WP_DEBUG_DISPLAY constant will always be set to false to match the Website behavior.

Disabling WP_DEBUG_DISPLAY will also avoid crashing the CLI during boot if a plugin activation fails. Long-term https://github.com/WordPress/wordpress-playground/issues/1979 shouldn't crash Playground anymore, but we still want these constant defaults in the CLI.

Testing Instructions (or ideally a Blueprint)

adamziel commented 2 weeks ago

I like having a --debug option, thank you @bgrgicak. I have concerns about the details and I left some comments.