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
Support using env(DATABASE_URL) #768
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 17, 2019
aschempp
reviewed
Sep 17, 2019
leofeyer
force-pushed
the
feature/dotenv
branch
from
September 18, 2019 12:21
2aca66d
to
cc3eea2
Compare
leofeyer
force-pushed
the
feature/dotenv
branch
from
September 19, 2019 09:38
cc3eea2
to
78299aa
Compare
leofeyer
force-pushed
the
feature/dotenv
branch
from
September 19, 2019 11:09
ce65b6b
to
194ad19
Compare
leofeyer
commented
Sep 19, 2019
leofeyer
changed the title
Use an .env file instead of a parameters.yml file
Support env(DATABASE_URL) and env(MAILER_URL)
Sep 19, 2019
leofeyer
changed the title
Support env(DATABASE_URL) and env(MAILER_URL)
Support using env(DATABASE_URL)
Sep 19, 2019
leofeyer
force-pushed
the
feature/dotenv
branch
from
September 19, 2019 19:56
4ae4400
to
9c7791e
Compare
This one is RTM now IMO. |
aschempp
reviewed
Sep 23, 2019
aschempp
reviewed
Sep 23, 2019
aschempp
reviewed
Sep 23, 2019
aschempp
reviewed
Sep 23, 2019
richardhj
pushed a commit
to richardhj/contao
that referenced
this pull request
Nov 15, 2019
…ao#230) Description ----------- Consider the following: ``` $model = new Contao\PageModel(); $model->title = 'Foo'; $model->attach(); ``` This works once per table (in this example, `tl_page`), because `Contao\Model\Registry::arrRegistry` then has one key for that table that is `""` (empty string): ``` array(13) { // … ["tl_page"]=> array(58) { [1]=> object(Contao\PageModel)contao#641 (6) { /* … */ } [4]=> object(Contao\PageModel)contao#768 (6) { /* … */ } // … [""]=> object(Contao\PageModel)contao#2094 (6) { /* Our Model */ } } // … } ``` Once we do the same thing again: ``` $model2 = new Contao\PageModel(); $model2->title = 'Bar'; $model2->attach(); ``` we suddenly get an exception: > The registry already contains an instance for tl_page::id() Obviously, this is not the expected behavior. The Registry should either categorically allow registering a model without a primary key or categorically not allow it. This fix implements the latter. It does not use `empty()` because that would overshoot and prevent the primary key from being `0` or `"0"`, which may not be recommendable, but does not have to be forbidden in this context. Commits ------- 3f33fc2 Do not allow registering a Model with an empty primary key 5011f8e Do not allow saving a Model with an invalid primary key 3aaaee2 Revert some changes and allow the primary key to be an empty string
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR supports using
env(APP_SECRET)
,env(DATABASE_URL)
andenv(MAILER_URL)
as recommended in the Symfony 4 best practices. If no env variables are present, a compiler pass dynamically adds them from theparameters.yml
configuration, therefore this change is 100% backwards compatible.