8000 [DependencyInjection] Added @@ escaping strategy for YamlFileLoader and YamlDumper by tPl0ch · Pull Request #7357 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Added @@ escaping strategy for YamlFileLoader and YamlDumper #7357

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

Closed
wants to merge 1 commit into from

Conversation

tPl0ch
Copy link
@tPl0ch tPl0ch commented Mar 13, 2013

Added the possibility to to use @@ as an escaping strategy for
parameters that should be treated as strings but start with @
(i.e. safe mailer passwords).

This PR is deprecating #7307, since as a new feature it has to be compared against the master branch.

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #4889

… and YamlDumper

Added the possibility to to use '@@' as an escaping strategy for
parameters that should be treated as strings but start with '@'
(i.e. safe mailer passwords).
@Strate
Copy link
Contributor
Strate commented Mar 21, 2013

I'm really need this feature in 2.2 branch.
Unfortunatelly I can't extend YamlFileLoader because method is private.
Please merge in 2.2 branch!

fabpot added a commit that referenced this pull request Mar 23, 2013
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7357).

Discussion
----------

[DependencyInjection] Added @@ escaping strategy for YamlFileLoader and YamlDumper

Added the possibility to to use ```@@``` as an escaping strategy for
parameters that should be treated as strings but start with ```@```
(i.e. safe mailer passwords).

This PR is deprecating #7307, since as a new feature it has to be compared against the master branch.

| Q | A |
| ------ | ------ |
|  Bug fix?  |  yes  |
|  New feature?  |  yes  |
|  BC breaks?  |  no  |
|  Deprecations?  |  no  |
|  Tests pass?  |  yes  |
|  Fixed tickets  |  #4889  |

Commits
-------

8cdf387 [DependencyInjection] Added '@@' escaping strategy for YamlFileLoader and YamlDumper
@fabpot
Copy link
Member
fabpot commented Mar 23, 2013

This has been merged in 2.1 as this is really more a bug fix than a new feature.

@fabpot fabpot closed this Mar 23, 2013
77web pushed a commit to 77web/symfony-docs that referenced this pull request Nov 23, 2013
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
@privacybob
Copy link

This doesn't work if the password is @MyPasswordIs@Right123@#

Error: "InvalidTypeException: Invalid type for path "doctrine.dbal.connections.default.password". Expected scalar, but got object."

@stloyd
Copy link
Contributor
stloyd commented Feb 11, 2014

@privacybob Use quotes.

@privacybob
Copy link

@stloyd I did, here's my parameters.yml:

parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root2
database_password: "@MyPasswordIs@Right123@#"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: b45ded6721a633cd5df5c2c3a0f7e159
database_path: null

@privacybob
Copy link

I just realized that the password needs to have two @ signs like this: @@MyPasswordIs@@right123@@#

Above password works.

@tPl0ch
Copy link
Author
tPl0ch commented Feb 11, 2014

@privacybob Yes, you can find the docs about that here: http://symfony.com/doc/current/book/service_container.html#service-parameters

And only the @ char at the beginning of the string hast to be escaped.
So the password should be @@MyPassWordIs@Right123@#

@tPl0ch tPl0ch deleted the feature/yaml-parameter-escape branch February 11, 2014 18:46
@privacybob
Copy link

Thanks @tPl0ch

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.

5 participants
0