8000 Merge branch '2.8' into 3.0 · symfony/symfony-docs@2d4ead6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d4ead6

Browse files
committed
Merge branch '2.8' into 3.0
2 parents 2dcecb3 + 2221df8 commit 2d4ead6

File tree

4 files changed

+156
-20
lines changed

4 files changed

+156
-20
lines changed

changelog.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,61 @@ documentation.
1313
Do you also want to participate in the Symfony Documentation? Take a look
1414
at the ":doc:`/contributing/documentation/overview`" article.
1515

16+
June, 2016
17+
----------
18+
19+
New Documentation
20+
~~~~~~~~~~~~~~~~~
21+
22+
* `#6690 <https://github.com/symfony/symfony-docs/pull/6690>`_ Added an example for a different method of verbosity level usage. (smatyas)
23+
* `#6587 <https://github.com/symfony/symfony-docs/pull/6587>`_ Updating recommended email settings for monolog (jorgelbg)
24+
25+
Fixed Documentation
26+
~~~~~~~~~~~~~~~~~~~
27+
28+
* `#6679 <https://github.com/symfony/symfony-docs/pull/6679>`_ Invalid PHP return statement (JohnnyEvo)
29+
* `#6675 <https://github.com/symfony/symfony-docs/pull/6675>`_ Update broken links to default VCL files (sgrodzicki)
30+
31+
Minor Documentation Changes
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
34+
* `#6597 <https://github.com/symfony/symfony-docs/pull/6597>`_ [Validator] Add shorter examples using the default option (alexmart)
35+
* `#6696 <https://github.com/symfony/symfony-docs/pull/6696>`_ Typo fix (jevgenijusr)
36+
* `#6693 <https://github.com/symfony/symfony-docs/pull/6693>`_ Add missing parameter (rodnaph)
37+
* `#6614 <https://github.com/symfony/symfony-docs/pull/6614>`_ Updated the CS rule about return null; and return; (javiereguiluz)
38+
* `#6680 <https://github.com/symfony/symfony-docs/pull/6680>`_ Fix ldap security examples (jvasseur)
39+
* `#6692 <https://github.com/symfony/symfony-docs/pull/6692>`_ Update date.rst - Fixes typo (fdarre)
40+
* `#6689 <https://github.com/symfony/symfony-docs/pull/6689>`_ Hard values for the driver option (iltar)
41+
* `#6685 <https://github.com/symfony/symfony-docs/pull/6685>`_ NullOutput should be passed to $command->run() (Ma27)
42+
* `#6676 <https://github.com/symfony/symfony-docs/pull/6676>`_ Removed 'html' from the component description (naroga)
43+
* `#6674 <https://github.com/symfony/symfony-docs/pull/6674>`_ CheckStyle in Voters cookbook (JakeFr)
44+
* `#6672 <https://github.com/symfony/symfony-docs/pull/6672>`_ [Book][Testing] remove Symfony core testing note (xabbuh)
45+
* `#6670 <https://github.com/symfony/symfony-docs/pull/6670>`_ Fix typo 'even' >> 'event' in event_listener.rst (kuusas)
46+
* `#6667 <https://github.com/symfony/symfony-docs/pull/6667>`_ [Contributing][Code] fix list item terminators (xabbuh)
47+
* `#6616 <https://github.com/symfony/symfony-docs/pull/6616>`_ Better explain the mandatory/convention location of some elements (rcousens, javiereguiluz)
48+
* `#6628 <https://github.com/symfony/symfony-docs/pull/6628>`_ Fix for #6625 (kix)
49+
* `#6668 <https://github.com/symfony/symfony-docs/pull/6668>`_ [Contributing][Code] remove PHPUnit requirement (xabbuh)
50+
* `#6654 <https://github.com/symfony/symfony-docs/pull/6654>`_ Update upload_file.rst (liubinas)
51+
* `#6650 <https://github.com/symfony/symfony-docs/pull/6650>`_ fix dumper default representation (Jamal Youssefi)
52+
* `#6652 <https://github.com/symfony/symfony-docs/pull/6652>`_ ``Finder::path()`` method matching directories and files (soyuka)
53+
* `#6662 <https://github.com/symfony/symfony-docs/pull/6662>`_ preg_match throw an warning (nicolae-stelian)
54+
* `#6658 <https://github.com/symfony/symfony-docs/pull/6658>`_ [Process] tweak a sentence (xabbuh)
55+
* `#6599 <https://github.com/symfony/symfony-docs/pull/6599>`_ Fixed null description of query_builder option (HeahDude)
56+
* `#6638 <https://github.com/symfony/symfony-docs/pull/6638>`_ swap terminate and exception event descriptions (xabbuh)
57+
* `#6615 <https://github.com/symfony/symfony-docs/pull/6615>`_ Minor grammar fix (aalaap)
58+
* `#6637 <https://github.com/symfony/symfony-docs/pull/6637>`_ Update security.rst (norbert-n)
59+
* `#6644 <https://github.com/symfony/symfony-docs/pull/6644>`_ [Console] Fix wrong quotes in QuestionHelper::setInputStream() (chalasr)
60+
* `#6645 <https://github.com/symfony/symfony-docs/pull/6645>`_ Fix bootstrap class name help-block (foaly-nr1)
61+
* `#6642 <https://github.com/symfony/symfony-docs/pull/6642>`_ do not reference unused interface (xabbuh)
62+
* `#6641 <https://github.com/symfony/symfony-docs/pull/6641>`_ [Book][Form] fix reference to renamed document (xabbuh)
63+
* `#6579 <https://github.com/symfony/symfony-docs/pull/6579>`_ Added callable validation_groups example (gnat42)
64+
* `#6626 <https://github.com/symfony/symfony-docs/pull/6626>`_ reflect the EOM of Symfony 2.3 (xabbuh)
65+
* `#6631 <https://github.com/symfony/symfony-docs/pull/6631>`_ Fix console.exception and console.terminate order (Julien Falque)
66+
* `#6629 <https://github.com/symfony/symfony-docs/pull/6629>`_ Update options_resolver.rst (atailouloute)
67+
* `#6627 <https://github.com/symfony/symfony-docs/pull/6627>`_ Fixed a typo in cookbook/security/entity_provider (michaeldegroot)
68+
* `#6618 <https://github.com/symfony/symfony-docs/pull/6618>`_ Added a note about coding standards and method arguments (javiereguiluz)
69+
70+
1671
May, 2016
1772
---------
1873

cookbook/security/impersonating_user.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ How to Impersonate a User
66

77
Sometimes, it's useful to be able to switch from one user to another without
88
having to log out and log in again (for instance when you are debugging or trying
9-
to understand a bug a user sees that you can't reproduce). This can be easily
10-
done by activating the ``switch_user`` firewall listener:
9+
to understand a bug a user sees that you can't reproduce).
10+
11+
.. caution::
12+
13+
User impersonation is not compatible with
14+
:doc:`pre authenticated firewalls </cookbook/security/pre_authenticated>`. The
15+
reason is that impersonation requires the authentication state to be maintained
16+
server-side, but pre-authenticated information (``SSL_CLIENT_S_DN_Email``,
17+
``REMOTE_USER`` or other) is sent in each request.
18+
19+
Impersonating the user can be easily done by activating the ``switch_user``
20+
firewall listener:
1121

1222
.. configuration-block::
1323

cookbook/security/pre_authenticated.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ box, Symfony supports most authentication mechanisms.
1111
These requests are called *pre authenticated* requests because the user is already
1212
authenticated when reaching your application.
1313

14+
.. caution::
15+
16+
:doc:`User impersonation </cookbook/security/impersonating_user>` is not
17+
compatible with pre-authenticated firewalls. The reason is that
18+
impersonation requires the authentication state to be maintained server-side,
19+
but pre-authenticated information (``SSL_CLIENT_S_DN_Email``, ``REMOTE_USER``
20+
or other) is sent in each request.
21+
1422
X.509 Client Certificate Authentication
1523
---------------------------------------
1624

@@ -149,9 +157,3 @@ key in the ``remote_user`` firewall configuration.
149157
See :ref:`the previous note <cookbook-security-pre-authenticated-user-provider-note>`
150158
for more information.
151159

152-
.. caution::
153-
154-
:doc:`User impersonation </cookbook/security/impersonating_user>` is not
155-
compatible with ``REMOTE_USER`` based authentication. The reason is that
156-
impersonation requires the authentication state to be maintained server-side
157-
but ``REMOTE_USER`` information is sent by the browser in each request.

cookbook/session/proxy_examples.rst

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,92 @@
44
Session Proxy Examples
55
======================
66

7-
The session proxy mechanism has a variety of uses and this example demonstrates
8-
two common uses. Rather than injecting the session handler as normal, a handler
9-
is injected into the proxy and registered with the session storage driver::
7+
The session proxy mechanism has a variety of uses and this article demonstrates
8+
two common uses. Rather than using the regular session handler, you can create
9+
a custom save handler just by defining a class that extends the
10+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy`
11+
class.
1012

11-
use Symfony\Component\HttpFoundation\Session\Session;
12-
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
13-
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
13+
Then, define a new service related to the custom session handler:
1414

15-
$proxy = new YourProxy(new PdoSessionHandler());
16-
$session = new Session(new NativeSessionStorage(array(), $proxy));
15+
.. configuration-block::
1716

18-
Below, you'll learn two real examples that can be used for ``YourProxy``:
19-
encryption of session data and readonly guest sessions.
17+
.. code-block:: yaml
18+
19+
# app/config/services.yml
20+
services:
21+
app.session_handler:
22+
class: AppBundle\Session\CustomSessionHandler
23+
24+
.. code-block:: xml
25+
26+
<!-- app/config/services.xml -->
27+
<?xml version="1.0" encoding="UTF-8" ?>
28+
<container xmlns="http://symfony.com/schema/dic/services"
29+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30+
xsi:schemaLocation="http://symfony.com/schema/dic/services
31+
http://symfony.com/schema/dic/services/services-1.0.xsd">
32+
33+
<services>
34+
<service id="app.session_handler" class="AppBundle\Session\CustomSessionHandler" />
35+
</services>
36+
</container>
37+
38+
.. code-block:: php
39+
40+
// app/config/config.php
41+
$container->register('app.session_handler', 'AppBundle\Session\CustomSessionHandler');
42+
43+
Finally, use the ``framework.session.handler_id`` configuration option to tell
44+
Symfony to use your own session handler instead of the default one:
45+
46+
.. configuration-block::
47+
48+
.. code-block:: yaml
49+
50+
# app/config/config.yml
51+
framework:
52+
session:
53+
# ...
54+
handler_id: app.session_handler
55+
56+
.. code-block:: xml
57+
58+
<!-- app/config/config.xml -->
59+
<?xml version="1.0" encoding="UTF-8" ?>
60+
<container xmlns="http://symfony.com/schema/dic/services"
61+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62+
xsi:schemaLocation="http://symfony.com/schema/dic/services
63+
http://symfony.com/schema/dic/services/services-1.0.xsd">
64+
<framework:config>
65+
<framework:session handler-id="app.session_handler" ... />
66+
</framework:config>
67+
</container>
68+
69+
.. code-block:: php
70+
71+
// app/config/config.php
72+
$container->loadFromExtension('framework', array(
73+
// ...
74+
'session' => array(
75+
// ...
76+
'handler_id' => 'app.session_handler',
77+
),
78+
));
79+
80+
Keep reading the next sections to learn how to use the session handlers in practice
81+
to solve two common use cases: encrypt session information and define readonly
82+
guest sessions.
2083

2184
Encryption of Session Data
2285
--------------------------
2386

2487
If you wanted to encrypt the session data, you could use the proxy to encrypt
2588
and decrypt the session as required::
2689

90+
// src/AppBundle/Session/EncryptedSessionProxy.php
91+
namespace AppBundle\Session;
92+
2793
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
2894

2995
class EncryptedSessionProxy extends SessionHandlerProxy
@@ -59,10 +125,13 @@ There are some applications where a session is required for guest users, but
59125
where there is no particular need to persist the session. In this case you
60126
can intercept the session before it is written::
61127

62-
use Foo\User;
128+
// src/AppBundle/Session/ReadOnlySessionProxy.php
129+
namespace AppBundle\Session;
130+
131+
use AppBundle\Entity\User;
63132
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
64133

65-
class ReadOnlyGuestSessionProxy extends SessionHandlerProxy
134+
class ReadOnlySessionProxy extends SessionHandlerProxy
66135
{
67136
private $user;
68137

0 commit comments

Comments
 (0)
0