niceandserious / crafty-vagrant

A boilerplate dev environment for jump-starting Craft CMS projects
MIT License
57 stars 13 forks source link

dotenv #14

Open nickautomatic opened 8 years ago

nickautomatic commented 8 years ago

Having config settings (eg. database credentials, site URL) in a .env file would not only potentially make multiple environment handling more elegant for Craft (see this), but could actually be shared by both Vagrant and Gulp (to, eg. avoid having craft.dev hard-coded as the server name anywhere)

nickautomatic commented 8 years ago

This is now completed for Vagrant, Puppet, and Gulp (they're all sharing a common .env config file), but the .env file is not currently used by Craft itself. That will require a little more thought, since it would probably make Composer a dependency, and would be sensible to test on a new site first before rolling it into Crafty.

peterlarkin commented 7 years ago

This seems like a good approach without requiring Composer. However, it would result in essentially 2 very similar config files.

nickautomatic commented 7 years ago

Another possibility would be to include the full version of makeItCraft - the full version installs dotenv as well (it does make Composer a dependency, though, but it handles the initial setup). I only used the "install Craft" part of it because the dotenv bit added complexity that we weren't planning on using at the time, but it might be worth trying now there is a .env file.

At the time I asked Matt Stauffer (who wrote makeItCraft) for permission to include it, and he said that was fine, so I think it should be ok to add the rest of it if needed.