Skip to content

Commit d235378

Browse files
committed
Merge branch '2.1' into 2.2
2 parents 8d6d6c3 + 40f7fdf commit d235378

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

book/service_container.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,23 @@ The end result is exactly the same as before - the difference is only in
227227
to look for parameters with those names. When the container is built, it
228228
looks up the value of each parameter and uses it in the service definition.
229229

230+
.. versionadded:: 2.1
231+
Escaping the ``@`` character in YAML parameter values is new in Symfony 2.1.9
232+
and Symfony 2.2.1.
233+
234+
.. note::
235+
236+
If you want to use a string that starts with an ``@`` sign as a parameter
237+
value (i.e. a very safe mailer password) in a yaml file, you need to escape
238+
it by adding another ``@`` sign (This only applies to the YAML format):
239+
240+
.. code-block:: yaml
241+
242+
# app/config/parameters.yml
243+
parameters:
244+
# This will be parsed as string "@securepass"
245+
mailer_password: "@@securepass"
246+
230247
The purpose of parameters is to feed information into services. Of course
231248
there was nothing wrong with defining the service without using any parameters.
232249
Parameters, however, have several advantages:

cookbook/security/target_path.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ How to change the Default Target Path Behavior
55
==============================================
66

77
By default, the security component retains the information of the last request
8-
URI in a session variable named ``_security.target_path``. Upon a successful
9-
login, the user is redirected to this path, as to help her continue from
10-
the last known page she visited.
8+
URI in a session variable named ``_security.main.target_path`` (with ``main`` being
9+
the name of the firewall, defined in ``security.yml``). Upon a successful
10+
login, the user is redirected to this path, as to help her continue from the
11+
last known page she visited.
1112

1213
On some occasions, this is unexpected. For example when the last request
1314
URI was an HTTP POST against a route which is configured to allow only a POST
@@ -61,7 +62,7 @@ Next, create your own ``ExceptionListener``::
6162
return;
6263
}
6364

64-
$request->getSession()->set('_security.target_path', $request->getUri());
65+
$request->getSession()->set('_security.main.target_path', $request->getUri());
6566
}
6667
}
6768

reference/configuration/security.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,34 @@ Each part will be explained in the next section.
6464
iterations: 1000
6565
6666
# Example options/values for what a custom encoder might look like
67-
Acme\Your\Class\Name:
68-
algorithm: ~
69-
ignore_case: false
70-
encode_as_base64: true
71-
iterations: 5000
72-
id: ~
67+
Acme\DemoBundle\Entity\User3:
68+
id: my.encoder.id
7369
7470
providers: # Required
7571
# Examples:
76-
memory:
77-
name: memory
78-
users:
79-
foo:
80-
password: foo
81-
roles: ROLE_USER
82-
bar:
83-
password: bar
84-
roles: [ROLE_USER, ROLE_ADMIN]
85-
entity:
72+
my_in_memory_provider:
73+
memory:
74+
users:
75+
foo:
76+
password: foo
77+
roles: ROLE_USER
78+
bar:
79+
password: bar
80+
roles: [ROLE_USER, ROLE_ADMIN]
81+
82+
my_entity_provider:
8683
entity:
87-
class: SecurityBundle:User
88-
property: username
84+
class: SecurityBundle:User
85+
property: username
8986
9087
# Example custom provider
91-
some_custom_provider:
88+
my_some_custom_provider:
9289
id: ~
90+
91+
# Chain some providers
92+
my_chain_provider:
9393
chain:
94-
providers: []
94+
providers: [ my_in_memory_provider, my_entity_provider ]
9595
9696
firewalls: # Required
9797
# Examples:

0 commit comments

Comments
 (0)