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

12-factor QoL : ENV -> Config fallback #47

Closed

Conversation

Lewiscowles1986
Copy link
Contributor

Another PR from the Heroku button.

This one is modified to avoid the need for a redundant config file in environments which are more geared towards receiving configuration via environment such as Heroku, Docker, CloudFoundry.

Because of the absence of a test suite runner right now, I've included a PHP online sandbox. Because it blacklists the class_exists method I've omitted that ternary, and I also directly set $_ENV to simulate environment input (mutable state FTW I guess)

http://sandbox.onlinephpfunctions.com/code/5487577392110c118827c529d8f0e183b31b7d93

Both the Docker PR's #34 & #43 would benefit from these works

lib/helpers.php Outdated Show resolved Hide resolved
views/docs/api.php Outdated Show resolved Hide resolved
@Lewiscowles1986
Copy link
Contributor Author

Yeah looks like that regression was in one place. I just scanned through again

aaronpk added a commit that referenced this pull request Jan 25, 2020
@aaronpk
Copy link
Owner

aaronpk commented Jan 25, 2020

Thanks for this. I ended up rewriting this to use the dotenv library which is a little cleaner than supporting all these methods in the project itself. You can now define the config variables either in a .env file or as environment variables.

@aaronpk aaronpk closed this Jan 25, 2020
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

Successfully merging this pull request may close these issues.

2 participants