[wp-trac] [WordPress Trac] #57487: Add support for "development mode"

WordPress Trac noreply at wordpress.org
Wed Jan 18 01:42:59 UTC 2023


#57487: Add support for "development mode"
-------------------------+-----------------------------
 Reporter:  azaozz       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:2 azaozz]:
 > The new constant should probably set both `WP_DEBUG` and `SCRIPT_DEBUG`
 to true, and also `WP_DEBUG_LOG` and `WP_DEBUG_DISPLAY`. Of course it
 would still be possible to override any of the existing constants. That
 would make it possible to fine-tune the behaviour.

 It's worth noting that `'development' === wp_get_environment_type()`
 [source:tags/6.1.1/src/wp-includes/default-constants.php?marks=82-86#L80
 already sets WP_DEBUG to true] as of [48372] / #33161, perhaps
 `SCRIPT_DEBUG` should be added there too?

 Just curious, is there a use case where setting `WP_ENVIRONMENT_TYPE` to
 `development` is not enough and a new constant is needed?

 > Also the `WP_ENVIRONMENT_TYPE` constant was deprecated, but is still
 needed/required in these cases which makes it... weird :)

 No, it was the `WP_ENVIRONMENT_TYPES` constant (note the plural name) that
 was deprecated in [48896] / #50992.

 The `WP_ENVIRONMENT_TYPE` constant is [source:tags/6.1.1/src/wp-
 includes/load.php?marks=229-232#L228 not deprecated] and can be used
 exactly when `getenv()` is not enabled or setting an environment variable
 is not preferable for some other reason.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57487#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list