-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Simplify configuration env var example #16575
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
Conversation
The |
@javiereguiluz or the other way, what about removing on the recipe? it adds no value here except thinking it is required for env to be "resolved" |
Yes, we can ask in the recipe server about this and see if there's a strong reason behind this. Thanks. |
This processor is needed when using a DSN for sqlite. |
@nicolas-grekas thx for the answer having the resolve here as first introduction of env var can mislead to using always the resolve as it is mandatory |
@94noni I agree on your last proposal: let's find a simpler example that doesn't require to use |
@javiereguiluz Hum what about the famous just a swap like: framework:
secret: '%env(APP_SECRET)%' |
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
https://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/doctrine |
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.
very unsure of those, may need careful review :s
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.
line 509 should be kept :)
Line 507 should be changed to:
xmlns:framework="http://symfony.com/schema/dic/symfony
Finally line 510 and 511 should be changed to refer to:
http://symfony.com/schema/dic/symfony
and
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd
a2bc20f
to
29e8c20
Compare
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 like this move, thanks!
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
https://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/doctrine |
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.
line 509 should be kept :)
Line 507 should be changed to:
xmlns:framework="http://symfony.com/schema/dic/symfony
Finally line 510 and 511 should be changed to refer to:
http://symfony.com/schema/dic/symfony
and
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd
status: needs review |
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.
Almost there :). Thanks!
https://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/doctrine | ||
https://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> | ||
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd> |
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.
You need to keep all the lines here just replacing doctrine/doctrine
part by symfony/symfony
:
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony/symfony
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd
">
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:doctrine="http://symfony.com/schema/dic/doctrine" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony |
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.
xmlns:framework="http://symfony.com/schema/dic/symfony | |
xmlns:framework="http://symfony.com/schema/dic/symfony" |
// by convention the env var names are always uppercase | ||
'url' => '%env(resolve:DATABASE_URL)%', | ||
'secret' => '%env(APP_SECRET)%', |
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.
There is one extra level here (framework.secret.secret
), this should be like:
$container->extension('framework', [
'secret' => '%env(APP_SECRET)%',
]);
Friendly ping @94noni |
thx for ping, will try to handle it in Feb as I will have some "free time" |
This PR was merged into the 5.4 branch. Discussion ---------- [Config] Simplify configuration env var example Hi, This PR supersede [this one](#16575) ``` Simplify here as the `resolve` is not needed, as reference it is documented in the dedicated doc page here https://symfony.com/doc/current/configuration/env_var_processors.html ``` [Targeting](#16575 (comment)) v5.4 instead of v4.4 friendly ping `@GromNaN` `@javiereguiluz` `@HeahDude` `@nicolas`-grekas as original reviewers Commits ------- b15ca74 Simplify configuration env var example
Simplify here as the
resolve
is not needed, as reference it is documented in the dedicated doc page herehttps://symfony.com/doc/current/configuration/env_var_processors.html