Cherry Blossom feature
Framework Traits: Environments trait
Identifies local, development, staging and production environments.
Identifies local, development, staging and production environments.
Capabilities and extension points
Identifies the configured WordPress environment and common environment groups.
The supported values are: – local Local dev environment; – development Online dev environment; – staging Stage in-between develop and production; AKA acceptance; – production Live server.
Returns the configured WordPress environment type.
- return string Environment type.
Determines whether the environment is local.
- return bool Environment is local.
Determines whether the environment is development.
- return bool Environment is dev.
Determines whether the environment is staging.
- return bool Environment is staging.
Determines whether the environment is production.
- return bool Environment is production.
Determines whether the environment is local or development.
This assumes that actual development happens on either "local" or "development" environments. For "staging", this should only be testing.
- return bool Environment is "dev"-level
Determines whether the environment is anything other than production.
In this context, "testing" is considered the direct opposite of "live". In practice, this covers everything but production.
- return bool Environment is "testing".
Determines whether the environment is production.
In this context, the only type of "live" environment recognised is production. Every other environment is classified as testing.
- return bool Environment is "live".
Source reference
This editable reference page is based on the PHP documentation in framework/traits/wordpress/trait-environments.php.