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

Skip to content

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

Merged
merged 4 commits into from
May 27, 2018

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented Mar 27, 2018

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

@mcfedr mcfedr changed the title Add description of the built in envvar processors [WIP] Add description of the built in envvar processors Mar 27, 2018
Copy link
Member

@javiereguiluz javiereguiluz left a 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)``
Copy link
Member

@javiereguiluz javiereguiluz Mar 28, 2018

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)``
Copy link
Member

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.

Copy link
Contributor Author

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)``
Copy link
Member

@javiereguiluz javiereguiluz Mar 28, 2018

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``)

Copy link
Contributor Author

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)%'

@javiereguiluz
Copy link
Member

@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!

@mcfedr
Copy link
Contributor Author

mcfedr commented May 24, 2018

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 env(FOO) because ENV_VAR_NAME seems confusing,

Anything you think is missing?

@mcfedr mcfedr force-pushed the env-var-processors branch from c904191 to af9448d Compare May 24, 2018 17:35
@mcfedr mcfedr force-pushed the env-var-processors branch from af9448d to e3fe5fe Compare May 24, 2018 17:38
@javiereguiluz javiereguiluz changed the title [WIP] Add description of the built in envvar processors Document the built in env var processors May 27, 2018
@javiereguiluz
Copy link
Member

@mcfedr thanks a lot for documenting this great feature. The only missing thing is the XML and PHP versions of all the YAML config examples. That's pretty boring, so let's merge this "as is" and I've created #9831 to look for volunteers who help us with that.

@javiereguiluz javiereguiluz merged commit aed1607 into symfony:master May 27, 2018
javiereguiluz added a commit that referenced this pull request May 27, 2018
…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 added a commit to javiereguiluz/symfony-docs that referenced this pull request May 27, 2018
…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
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request May 27, 2018
…mcfedr, javiereguiluz)"

This reverts commit c98569d, reversing
changes made to 2a76e88.
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request May 27, 2018
* 3.4:
  minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request May 27, 2018
* 4.0:
  minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request May 27, 2018
* 4.1:
  minor symfony#9507 Document the built in env var processors (mcfedr, javiereguiluz)
xabbuh added a commit that referenced this pull request Jun 2, 2018
xabbuh added a commit that referenced this pull request Jun 2, 2018
* 3.4:
  [#9507] remove csv processor, it was added in 4.1
xabbuh added a commit that referenced this pull request Jun 2, 2018
* 4.0:
  [#9507] remove csv processor, it was added in 4.1
xabbuh added a commit that referenced this pull request Jun 2, 2018
xabbuh added a commit that referenced this pull request Jun 2, 2018
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jun 6, 2018
* 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
weaverryan added a commit that referenced this pull request Jun 11, 2018
* 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
  ...
Guikingone pushed a commit to Guikingone/symfony-docs that referenced this pull request Feb 12, 2019
…mcfedr, javiereguiluz)"

This reverts commit c98569d, reversing
changes made to 2a76e88.
Guikingone pushed a commit to Guikingone/symfony-docs that referenced this pull request Feb 12, 2019
Guikingone pushed a commit to Guikingone/symfony-docs that referenced this pull request Feb 12, 2019
Guikingone pushed a commit to Guikingone/symfony-docs that referenced this pull request Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update %env()% documentation
4 participants