Comments (7)
@simonrjones any updates on this?
from wordpress-multi-env-config.
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.
from wordpress-multi-env-config.
@simonrjones thanks for looking into it.
You actually already have a suggested Pull request that will fix the multiple hostname issue #32.
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?
from wordpress-multi-env-config.
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.
from wordpress-multi-env-config.
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..
from wordpress-multi-env-config.
@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!
from wordpress-multi-env-config.
I'm testing the v3 release of this package, which includes support for WP_ENVIRONMENT_TYPE and some improved documentation.
from wordpress-multi-env-config.
Related Issues (20)
- .gitignore rules HOT 2
- WP-CLI error HOT 9
- Wordpress in sub-directory not working without defining WP_HOME, WP_SITEURL HOT 5
- Force SSL HOT 4
- How about setting diffrent db prefixes based on env aswell? HOT 3
- Ignore plugins based on env HOT 2
- URLs need updating HOT 2
- New WP-cli issue HOT 9
- Cannot determine current environment domain HOT 1
- Using XAMPP localhost HOT 1
- Over-escaping breaking wildcard domain matching
- Use with W3 Total Cache HOT 5
- Can i use $env in theme
- Can't use array for multisite across multiple environments HOT 6
- SITE_URL and HOME are overridden HOT 1
- Add composer.json HOT 3
- can you use 'localhost' as the domain hostname? HOT 1
- Database error HOT 3
- wp cli database error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-multi-env-config.