[Book][ServiceContainer] Added docs for YAML '@@' escaping #2354

Merged
merged 1 commit into from Mar 31, 2013

Projects

None yet

4 participants

@tPl0ch

This PR deprecates #2286

Q A
Doc fix? no
New docs? yes symfony/symfony#7357
Applies to 2.1+
Fixed tickets symfony/symfony#4889
@wouterj wouterj commented on an outdated diff Mar 24, 2013
book/service_container.rst
@@ -231,6 +231,20 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. note::
+
+ If you want to use a string that starts with an ``@`` sign as a parameter
+ value (i.e. a very safe mailer password) in a yaml file, you need to escape
+ it by adding another ``@`` sign (This only applies to the YAML format):
+
+ .. code-block:: yaml
@wouterj
wouterj Mar 24, 2013

one indent to much

@wouterj
Symfony member

I've never seen a Travis build on the Symfony Docs :-) (it can be an idea though...)

@wouterj wouterj commented on an outdated diff Mar 24, 2013
book/service_container.rst
@@ -231,6 +231,20 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. note::
+
+ If you want to use a string that starts with an ``@`` sign as a parameter
@wouterj
wouterj Mar 24, 2013

Please add a .. versionadded:: 2.1 directive.

@wouterj wouterj commented on an outdated diff Mar 24, 2013
book/service_container.rst
@@ -231,6 +231,20 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. note::
+
+ If you want to use a string that starts with an ``@`` sign as a parameter
+ value (i.e. a very safe mailer password) in a yaml file, you need to escape
+ it by adding another ``@`` sign (This only applies to the YAML format):
+
+ .. code-block:: yaml
+
+ # app/config/parameters.yml
+ parameters:
+ # This will be parsed as string "@securepass"
+ mailer_password: @@securepass
@wouterj
wouterj Mar 24, 2013

The code itself should be indented 4 spaces.

And you should put @@securepass into quotes as @ is a reserved character in Yaml.

@tPl0ch

@WouterJ Fixed the outstanding issues. Concerning the Travis build: I just activated the wrong repository :-D

@wouterj wouterj commented on an outdated diff Mar 25, 2013
book/service_container.rst
@@ -231,6 +231,21 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. note::
+
+ .. versionadded:: 2.1
@wouterj
wouterj Mar 25, 2013

You should use something like this:

.. versionadded:: 2.1
    Escaping the ``@`` character is new in Symfony 2.1.

.. note::

    If you want to use ....
@tPl0ch

@WouterJ Please tell me that I got this right this time, meeeeh.

:-)

@wouterj
Symfony member

@tPl0ch yes, it's perfect now! 👍

@stof stof commented on the diff Mar 25, 2013
book/service_container.rst
@@ -231,6 +231,23 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. versionadded:: 2.1
+ Escaping the ``@`` character in YAML parameter values is new in Symfony 2.1.
@stof
stof Mar 25, 2013

It is new in 2.1.9 and 2.2.1, it is not available in 2.1.8 and 2.2.0

@tPl0ch
tPl0ch Mar 26, 2013

@stof I added the specific versions now.

@wouterj wouterj and 1 other commented on an outdated diff Mar 26, 2013
book/service_container.rst
@@ -231,6 +231,24 @@ looks up the value of each parameter and uses it in the service definition.
<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
+.. versionadded:: 2.1
+ Escaping the ``@`` character in YAML parameter values is new in Symfony 2.1.9
+ and Symfony 2.2.1!
@wouterj
wouterj Mar 26, 2013

I don't like the exclamation mark, I think it's to informal for the docs.

@tPl0ch
tPl0ch Mar 26, 2013

@WouterJ I am seriously struggling more with the doc formatting then with actual coding. But I think it should be correct now.

@wouterj
wouterj Mar 26, 2013

@tPl0ch well, you get used to it. Most people are not familair with RsT/Sphinx. It's like doing a PR on the core code while you just learned PHP.
The only difference is that we put comments on it (because we want your docs) and the core code will reject your PR 😉

Thomas Ploch [Book][ServiceContainer] Added docs for YAML '@@' escaping
This PR deprecates symfony#2286

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes symfony/symfony#7357
| Applies to    | 2.1
| Fixed tickets | symfony/symfony#4889
ed39ba0
@weaverryan weaverryan merged commit ed39ba0 into symfony:2.1 Mar 31, 2013
@weaverryan
Symfony member

Hi Thomas!

Very nice - thanks for making all these revision - it was an easy merge.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment