-
Notifications
You must be signed in to change notification settings - Fork 113
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
Allow settings via Environment variables #57
Comments
Subscribing myself to this issue. Btw, @Giuseppe-Mazzapica … I like your version of my name. I should be more YOsef these days. |
@franz-josef-kaiser LOL (fixed) |
Sounds reasonable to me. I'd happily review a PR. Since this is something it sounds like you guys do regularly, do you have any other projects that take a similar approach?
Happy to pick this up as well. I don't use Composer with WordPress frequently, so happy to take some direction from those who do. |
Perfect, I'll work on it very soon.
Usage of environment variables in WordPress is something that I started to do recently. Before that, I used them in Laravel and general PHP works. I started to use them in WordPress since I released WP Starter and since then I've used env vars in different works, but unluckily nothing public. Roots (and its components) are pretty popular packages that make use of env vars. |
Closing this as @Giuseppe-Mazzapica opened the more actionable #58. |
I landed Composer support in #51. I know you guys use Composer more extensively with WP. If you have any suggestions, please let me know. |
First of all thanks for your work this.
Me, @franz-josef-kaiser and other fellows are very interested on the usage of this package on a pretty big website and integrate it in our workflow that is based on Composer and environment variables.
I already seen there's a PR about supporting Composer, and that's fine, so what is missing is the second part.
What I have in mind is something that affect only
WP_Object_Cache
constructor, that should be something like this:In this way would be pretty simple to add servers like this:
With a little edit on code above it would be also possible support unix socket (as proposed in #42) and for authentication (related: #32):
Finally, a very similar approach can be used to support various Memcached settings (related: #40) using a single ENV var (e.g.
WP_MEMCACHED_CONFIG
) or more variables, one per setting.I think that a configuration based on environment variables would be apprecciated by a lot people: Bedrock is pretty popular, and WP Starter is young but promising, even if I'm biased regarding the latter.
Moreover, per code above, it only has effect if global var is not set and the environment variable is, so it will not affect who don't use environment vars.
If you like this idea I can make a PR.
The text was updated successfully, but these errors were encountered: