Welcome Guest, Not a member yet? Register   Sign In
.env Questions
#5

(This post was last modified: 10-05-2019, 04:58 PM by MGatner.)

Avoiding .env for production is fine but certainly not a requirement nor a best practice. The point of the .env is two-fold:
Provide a way to differentiate settings across multiple environments, and provide a secure location (e.g. not included in version tracking) for sensitive data. If your variables you want to add fall into either of the categories I’d say it’s a good place. If you’re looking to use it simply as an easy way to load common settings I’d recommend using a
Config file instead, as they are only loaded on-demand and have a lot more flexibility as to what you can put in them.

As for accessing variables, use the env() command you make it super easy.

https://codeigniter4.github.io/CodeIgnit...s.html#env

Also check out https://codeigniter4.github.io/CodeIgnit...ments.html
Reply


Messages In This Thread
.env Questions - by Poetawd - 10-05-2019, 09:04 AM
RE: .env Questions - by dave friend - 10-05-2019, 09:37 AM
RE: .env Questions - by Poetawd - 10-05-2019, 09:55 AM
RE: .env Questions - by dave friend - 10-05-2019, 02:01 PM
RE: .env Questions - by MGatner - 10-05-2019, 04:55 PM
RE: .env Questions - by Poetawd - 10-05-2019, 05:00 PM
RE: .env Questions - by kilishan - 10-05-2019, 08:32 PM
RE: .env Questions - by John_Betong - 10-06-2019, 06:34 AM
RE: .env Questions - by InsiteFX - 10-06-2019, 08:19 AM
RE: .env Questions - by dave friend - 10-06-2019, 09:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB