[wp-trac] [WordPress Trac] #46047: Rename shutdown handler constant to allow it to be used for disabling it altogether
WordPress Trac
noreply at wordpress.org
Mon Jan 21 10:21:32 UTC 2019
#46047: Rename shutdown handler constant to allow it to be used for disabling it
altogether
----------------------------------+---------------------
Reporter: schlessera | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.1
Component: Bootstrap/Load | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch servehappy | Focuses:
----------------------------------+---------------------
Comment (by flixos90):
Regardless of the name we choose, I suggest to add the `WP_DISABLE_*`
constant as an entirely new constant, in addition to
`WP_EXECUTION_SUCCEEDED`. While they are closely related, semantically
they are not the same:
* One flags that WordPress has successfully loaded so that the shutdown
handler should not run.
* One disables the shutdown handler entirely.
The new `WP_DISABLE_*` would be purely for definition in `wp-config.php`,
and I suggest to put the check for it into the
`wp_register_premature_shutdown_handler()` function: If it is defined and
true, don't even register any shutdown handler. This separates the two
concerns and also allows mitigating the problem in #46038 easily, for
example in a development setup.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46047#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list