Comments (9)
If you're on Unix, I would recommend to set WP_ENV via environment variable and avoid using --env
, it never worked for me (I haven't tried it with current master though).
Either specify WP_ENV
explicitly for a single command:
$ WP_ENV=development <your-wp-cli-command>
Or set WP_ENV
for entire terminal session:
$ export WP_ENV=development
$ <your-wp-cli-command>
$ <another-wp-cli-command>
from wordpress-multi-env-config.
yeah i tried that also, cheers. This is on the current master, before changes were merged in it worked ok.
from wordpress-multi-env-config.
Any updates on this issue ? :( really would like to use this but, I'm dependent on WP-CLI
from wordpress-multi-env-config.
No updates as of yet, I am also dependant on WP-CLI and am eagerly awaiting some help with this. It may be worth reverting to the previous version until this important issue is fixed...
from wordpress-multi-env-config.
Hi @newtlabs / @etiennejcharles ,
I've had a quick look at this, and found a fix which is working for me locally.
I've created a branch and submitted a pull request (#25), until that has been reviewed and merged in though, you should be able to manually copy the fix for any of your local projects using this diff:
https://github.com/studio24/wordpress-multi-env-config/pull/25/files
As previously stated, you'll either need to set the environment variable for your machine like so:
export WP_ENV=development
(preferrably this would go in your .bash_profile
so that you don't need to run this every time you open a new terminal window/tab).
Passing env
to the CLI should also work (although I've not tested this as I have the environment variable setup on my machine):
wp plugin list --env="development"
from wordpress-multi-env-config.
@sean-dunwoody - Good job on the fix, although, I use browsersync to develop, meaning my domain can be multiple values, in the case where I have the domain as an array it doesnt work.
May I suggest the following to your fix ? If theres an array of values, to return the first value?
from wordpress-multi-env-config.
Any chance of taking another look at this? Am snowed under with 50 WP sites to look after and being able to use WP-CLI would be a massive help.
from wordpress-multi-env-config.
OK, have merged in Sean's fix for this issue and tested on a WP project that wasn't working under WP CLI. Now works fine.
Will leave the array fixes for now. Will move that request into a new GitHub issue.
Simon
from wordpress-multi-env-config.
Actually, on review, I will add support for the array domains. Forgot that was supported in this tool.
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
- 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
- Update to use WP_ENVIRONMENT_TYPE HOT 7
- 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.