crafty-vagrant icon indicating copy to clipboard operation
crafty-vagrant copied to clipboard

dotenv

Open nickautomatic opened this issue 8 years ago • 3 comments

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 avatar Mar 23 '16 19:03 nickautomatic

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.

nickautomatic avatar Jun 15 '16 12:06 nickautomatic

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

peterlarkin avatar Sep 04 '17 22:09 peterlarkin

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.

nickautomatic avatar Sep 04 '17 22:09 nickautomatic