Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Docker support #34
base: main
Are you sure you want to change the base?
Docker support #34
Changes from all commits
8cda0f8
036fbfa
fb353ff
fa9de71
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this self-defeating to make the values globally available twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only easy option.
You can't set static properties dynamically with function call so I have to first save them into constants.
But it may also work with normal variables instead of constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think putting the argument in the connection utility fits better with a heroku + docker (12-factor) deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this a bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead of having config be the source for all things, you could instead build an interface and have multiple implementations that fulfil that interface to provide details.
A Lighter weight option that does similar would be using null coalesce operator, leaving the config as null, and
Config::$value ?? ENV['ENV_VAR1'] ?? ENV['ENV_VAR2'];
http://sandbox.onlinephpfunctions.com/code/22d382de6f0128a63d11ba37b79a4c7d3faad57a is a trivial example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is now setting properties directly from env vars. It doesn't need null coalesce operator, because env vars need to be set anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there has been confusion about my meaning.
Also blank string is not really the best option.
null specifically says "unknown"