I’ve recently switched to a rather rad workflow involving a local copy of our website run through MAMP using a git repository.
We’ve recently started working on a bigger set of changes that require a feature branch. But, these changes also will require WordPress to be upgraded to 3.3, requiring database changes. Making it impossible to use the same database.
I was able to come up with this nifty technique for determining which DB to use.
That’s all there is to it. It works flawlessly.
Happy coding.
very well. I like your sharing. thank you.
Thanks for giving me the useful information. I think I need
it. Thank you
The details are well-explained and very concise.
nice! thank so much!
Thanks for one more way to improve my skills as front-end developer.
This is really Good news you have shared with us. You have a very interesting blogging style. I really like the way you present. Thanks for sharing this quality information with us. I really enjoyed reading.
after hours of work tired, you need entertainment. Refer to our website. hope you get the most comfortable
I’m glad you enjoyed it. Those are great habits! Thank you for sharing.
Wonderful blog! This is very informative site. I am totally pleased by your excellent work. Many thanks for sharing.
This article is really fantastic and thanks for sharing the valuable post.
I would like to thank you for your nicely written post
I’m happy about everything you bring it very interesting and helpful, thanks
Thanks for sharing this quality information with us. I like this information. Keep posting.
I recommend not hacking around to parse the branch name, but do this instead – clean output.
// This runs a CLI Git command, which returns the name of the current Git branch
// Note that this will have an issue in any situation where Git has a detached HEAD
// Like checking out a specific commit/tag
$cmd = “/usr/bin/git symbolic-ref –short HEAD”; //must use full path/to/git for cmd to work
exec($cmd,$cmdOutput);
$currentBranch = $cmdOutput[0];
if ($currentBranch != “master”) {