Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Configuration] env() parameters notation #18898

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

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

alexandre-daubois
Copy link
Member

Fix #13678

We explain above how to define a env var value, so it seems neat to put this explanation here, "if it has not been defined anywhere" πŸ™‚

@alexandre-daubois alexandre-daubois changed the base branch from 6.4 to 5.4 September 20, 2023 07:46
@@ -674,6 +674,53 @@ To define the value of an env var, you have several options:
* :ref:`Encrypt the value as a secret <configuration-secrets>`;
* Set the value as a real environment variable in your shell or your web server.

It is possible to define an env var default value by defining a parameter with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT to explain in which case is needed ?

The only case is see is when env var if it's not set. If we don't configure this default symfony will throw an exception, right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the "if it has not been defined anywhere" part on line 679 explicit enough? If no, I can add something else indeed!

@javiereguiluz javiereguiluz added this to the 5.4 milestone Sep 22, 2023
@javiereguiluz javiereguiluz merged commit cc8487d into symfony:5.4 Sep 22, 2023
@javiereguiluz
Copy link
Member

Thanks Alex. While merging we reworded this a bit to first explain the problem (if env var is not defined, you'll see an exception) and then the solution (define a default value for the env var).

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.

Explain the env() notation in parameters for defaulting env vars value
3 participants