Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Variables #46

Closed
greydnls opened this issue Oct 31, 2014 · 1 comment
Closed

Nested Variables #46

greydnls opened this issue Oct 31, 2014 · 1 comment

Comments

@greydnls
Copy link
Contributor

It would be great to have nested variables so I can do something like

$_ENV[‘database’][‘connection_name’][‘username’]

in the .env file it could be something as simple as:

database.connection_name.username = johndoe

and then the package could read that into an array correctly when it loads the file.
Is that a possibility?

@vlucas
Copy link
Owner

vlucas commented Nov 3, 2014

That's not a possibility with this library, because all environment variables are just set as flat strings, and I don't want phpdotenv to differ from the way environment variables are handled on the system. It's a bit obtuse to have no array support and everything as a string (even integers, boolean, etc.), but that's the way ENV works.

That said, phpdotenv is not a total config replacement, so it should only be used for settings that need to be secret, or need to be set/changed on the fly at runtime without code updates.

@vlucas vlucas closed this as completed May 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants