Welcome Guest, Not a member yet? Register   Sign In
Working with Configuration Files
#5

(05-29-2018, 07:06 AM)dave friend Wrote: A follow-up question.

So, if I understand correctly, given the very typical development + production environments setup, each would need their own .env file. That feels a bit fragile to me because it would be far too easy to accidentally overwrite the production version with the dev version during an FTP upload for instance. (Something I used to do on a regular basis with config.php before I figured out how to properly handle multiple environments under v3.  Blush )

Is there any way to leverage the /Config/Boot environment specific files to manage values as set in the Config\App, Config\Database, etc. namespaces?

I'm not sure if I understand you correctly, - but I may mention an implementation which covers my needs very well. I've an app which I deploy on multiple sites, - which has different configurations. I've customized the index.php. Based on a logic where I look for a folder under config which has a name equal the current hostname using the gethostname() function. If the "hostname" folder exist, - all configuration files are read from this folder. If the folder doesn't exist, - default config files are read from /config. I feel this is a very flexible solution.

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Working with Configuration Files - by dave friend - 05-27-2018, 11:59 AM
RE: Working with Configuration Files - by geirarnesen - 05-29-2018, 12:03 PM
RE: Working with Configuration Files - by b126 - 03-06-2024, 10:41 AM
RE: Working with Configuration Files - by b126 - 03-07-2024, 03:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB