-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Document the built in env var processors #9507
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
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.
@mcfedr thanks for working on this! It's a great feature and the docs you propose are very nice: concise and well explained!
|
||
A number of different types are supported: | ||
|
||
``env(string):FOO)`` |
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.
Typo: should be env(string:FOO)
|
||
A number of different types are supported: | ||
|
||
``env(string):FOO)`` |
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'm not a big fan of using foo
and bar
in docs because I prefer to use more realistic examples. For example we could use ENV_VAR_NAME
instead of FOO
. But before making any change, let's wait for other opinions.
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 its a fair point, and more consistent with the style of the docs in general
``env(float:FOO)`` | ||
Casts ``FOO`` to an float | ||
|
||
``env(const:FOO)`` |
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 it'd be great to show a super simple example for each of these cases. Example:
``env(const:FOO)``
Finds the const value named in ``FOO`` (e.g. ``FOO=App\Config\UserConfig::FIREWALL_KEY``)
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.
Yes, I agree,
I was wondering if its useful to show even something like
parameters:
env(FOO): Some\Const
framework:
something: '%env(const:FOO)%'
@mcfedr will you have some time before this months end to finish this PR? This is a top priority feature and we'd like to end the docs soon. It's OK if you don't have time because we can take it over for you. Cheers! |
I have added the extra examples that were missing originally. These mostly show examples of how it can be used. I kept to the sections using Anything you think is missing? |
c904191
to
af9448d
Compare
af9448d
to
e3fe5fe
Compare
…guiluz) This PR was merged into the master branch. Discussion ---------- Document the built in env var processors This is start at adding documentation for env var processors, e.g. `%env(int:FOO)%` I would welcome some feedback, if this a appropriate way to go about this, I think it needs some more examples to show how its used. It also would ideally add a description of how custom processors are added, although that might be a later request. starts to fix #8382, #9094 Commits ------- aed1607 Minor rewords and formatting fixes e3fe5fe Example of customer env var processor 67227a6 Add examples for parameter processors cd353c7 Add description of the built in envvar processors
…javiereguiluz) This PR was merged into the 3.4 branch. Discussion ---------- Document the built in env var processors This is start at adding documentation for env var processors, e.g. `%env(int:FOO)%` I would welcome some feedback, if this a appropriate way to go about this, I think it needs some more examples to show how its used. It also would ideally add a description of how custom processors are added, although that might be a later request. starts to fix symfony#8382, symfony#9094 Commits ------- aed1607 Minor rewords and formatting fixes e3fe5fe Example of customer env var processor 67227a6 Add examples for parameter processors cd353c7 Add description of the built in envvar processors
* 3.4: minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
* 4.0: minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
* 4.1: minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
* 3.4: [#9507] remove csv processor, it was added in 4.1
* 4.0: [#9507] remove csv processor, it was added in 4.1
* 4.1: Fixed some wrong file paths Change code file location Fix typo for variable name Add link to configuration documentation Update upgrade_major.rst Add composer require symfony/webpack-encore-pack Reword the intro of a console article fix(Caution): Validator folder for YAML or XML format Fix the interface/abstract classes documentation Fix typo in Memcached adapter documentation [symfony#9507] add versionadded directive Revert "[symfony#9507] remove csv processor, it was added in 4.1" [symfony#9507] remove csv processor, it was added in 4.1
* 4.0: (24 commits) updating the guard session migration details for Symfony 3.4 changes Avoiding authentication on every request with Guard Minor typo in csrf.rst [Filesystem] Improved the code of an example Removed another usage of mt_rand() Transition from mt_rand to random_int Update setup.rst remove not existent label_attr options from buttons Fixed some code indentation Added the versionadded directive add missing XML and PHP code examples Expanded the explanation a bit Minor fixes Update licence hint for JMS serializer Revert "minor #9507 Document the built in env var processors (mcfedr, javiereguiluz)" Minor rewords and formatting fixes Example of customer env var processor Add examples for parameter processors Add description of the built in envvar processors Mention that "exclude" option now accepts arrays too ...
This reverts commit 50bddbd.
This is start at adding documentation for env var processors, e.g.
%env(int:FOO)%
I would welcome some feedback, if this a appropriate way to go about this, I think it needs some more examples to show how its used.
It also would ideally add a description of how custom processors are added, although that might be a later request.
starts to fix #8382, #9094