-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to use WP_ENVIRONMENT_TYPE #37
Comments
@simonrjones any updates on this? |
hi - sorry for the delayed reply. This is a good idea & I will update the codebase to support this. This may be a breaking change, if so this will be released as 3.0 I am considering removing support for setting the environment dynamically based on the current hostname in wp-config.env.php. This should also resolve any issues with multiple hostnames (see #29 and #32). Using environment variables, or using a local .env file, seems best practise to me so if I'm adding a breaking change encouraging this seems a good idea. Any feedback appreciated. |
@simonrjones thanks for looking into it. If you were to remove the ability to dynamically set the environment, how would the environment have to be set? Via a 'define()'? And if that's the case, then how would this differ from the default standard wp-config.php? |
Thanks, I am about to test & merge that PR. The core purpose for this repo is to load different config settings based on the current environments. A secondary purpose is setting the environment automatically based on hostname. It sounds like this secondary use case is really useful to you, is that correct? I'm just taking this opportunity to review if that still makes sense or whether there are better practice ways this is done on WP projects. It may make sense to remain backward compatible and continue to support this. I'm going to check with my team too on current usage & get feedback. |
Hi Simon, I'm using this on around 50 sites and it seems to work perfectly so if you want any feedback I'll be happy to help. I'm using the wp-config.env.php to set the hostname and I also add the .env file for live/staging.. |
@simonrjones You're spot on. The primary purpose of the repo works like a charm and is the core reason I (and probably most of us) use it. But the secondary purpose (of automatically setting the environment based on the hostname) works extremely effectively, so I'm a huge fan of keeping it (as it seems @newtlabs is as well). I'm curious to hear what the team suggested in terms of future plans. Keep us posted! |
I'm testing the v3 release of this package, which includes support for WP_ENVIRONMENT_TYPE and some improved documentation. |
Hi!
LOVING this multi-environment config setup. It's truly fantastic, so thanks for sharing!
As you probably know, WordPress 5.5 introduced a new wp_get_environment_type() function.
https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/
It would be great to update the code in the Multi-Environment config files to define WP_ENVIRONMENT_TYPE.
The text was updated successfully, but these errors were encountered: