[wp-trac] [WordPress Trac] #33161: Create a standard for defining and identifying site environment
WordPress Trac
noreply at wordpress.org
Sun Jun 7 20:14:27 UTC 2020
#33161: Create a standard for defining and identifying site environment
--------------------------------+-----------------------------
Reporter: krogsgard | Owner: SergeyBiryukov
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.5
Component: Options, Meta APIs | Version: 4.2
Severity: normal | Resolution: fixed
Keywords: needs-dev-note | Focuses:
--------------------------------+-----------------------------
Comment (by dlh):
In a future iteration of this patch, I wonder whether this comment above
the `wp_get_environment_type` filter could be clarified:
> This filter runs before it can be used by plugins. It is designed for
non-web runtimes.
Since nothing is yet invoking `wp_get_environment_type()`, it's unclear
why plugins are unable to use it.
Also, a plugin still could add a filter to it, and subsequent calls to
`wp_get_environment_type()` would honor the filter. It sounds as though
something is going to have been defined before the plugin can act — it's
just not clear what.
Secondarily, it would be great if there was a sanctioned way for all
runtimes to be able to modify the list of allowed environments, perhaps
through a constant similar to `WP_ENVIRONMENT_TYPE`.
To take one example: As noted by @johnbillion's plugin, the VIP Go
platform offers a `develop` environment, which is not the same as our
local development environments. In this case, it would be confusing, if
nothing else, for our local environments to be `development`, as would
labeling VIP's `develop` environment as `stage`, since there can also be a
`stage` environment.
Using the example of one VIP Go project I'm familiar with, it would be
much preferable to be able to list `array( 'local', 'develop', 'preprod',
'production' )`, which mirror the names given to the existing
environments.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33161#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list