Skip to content

Commit 130e55b

Browse files
committed
Merge branch '2.3' into 2.7
2 parents 703abe3 + 400873c commit 130e55b

17 files changed

+57
-66
lines changed

book/doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,10 @@ Take a look at the previous example in more detail:
534534
responsible for handling the process of persisting and fetching objects
535535
to and from the database.
536536

537-
* **line 16** The ``persist()`` method tells Doctrine to "manage" the ``$product``
537+
* **line 17** The ``persist()`` method tells Doctrine to "manage" the ``$product``
538538
object. This does not actually cause a query to be made to the database (yet).
539539

540-
* **line 17** When the ``flush()`` method is called, Doctrine looks through
540+
* **line 18** When the ``flush()`` method is called, Doctrine looks through
541541
all of the objects that it's managing to see if they need to be persisted
542542
to the database. In this example, the ``$product`` object has not been
543543
persisted yet, so the entity manager executes an ``INSERT`` query and a

book/routing.rst

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,25 +1473,14 @@ route. With this information, any URL can easily be generated::
14731473

14741474
.. note::
14751475

1476-
In controllers that don't extend Symfony's base
1477-
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`,
1478-
you can use the ``router`` service's
1479-
:method:`Symfony\\Component\\Routing\\Router::generate` method::
1476+
The ``generateUrl()`` method defined in the base
1477+
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller` class is
1478+
just a shortcut for this code::
14801479

1481-
use Symfony\Component\DependencyInjection\ContainerAware;
1482-
1483-
class MainController extends ContainerAware
1484-
{
1485-
public function showAction($slug)
1486-
{
1487-
// ...
1488-
1489-
$url = $this->container->get('router')->generate(
1490-
'blog_show',
1491-
array('slug' => 'my-blog-post')
1492-
);
1493-
}
1494-
}
1480+
$url = $this->container->get('router')->generate(
1481+
'blog_show',
1482+
array('slug' => 'my-blog-post')
1483+
);
14951484

14961485
In an upcoming section, you'll learn how to generate URLs from inside templates.
14971486

book/service_container.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,10 @@ The service container is built using a single configuration resource
276276
be imported from inside this file in one way or another. This gives you absolute
277277
flexibility over the services in your application.
278278

279-
External service configuration can be imported in two different ways. The first
280-
method, commonly used to import container configuration from the bundles you've
281-
created - is via the ``imports`` directive. The second method, although slightly more
282-
complex offers more flexibility and is commonly used to import third-party bundle
279+
External service configuration can be imported in two different ways. The first
280+
method, commonly used to import container configuration from the bundles you've
281+
created - is via the ``imports`` directive. The second method, although slightly more
282+
complex offers more flexibility and is commonly used to import third-party bundle
283283
configuration. Read on to learn more about both methods.
284284

285285
.. index::
@@ -1104,13 +1104,15 @@ to be used for a specific purpose. Take the following example:
11041104
xsi:schemaLocation="http://symfony.com/schema/dic/services
11051105
http://symfony.com/schema/dic/services/services-1.0.xsd">
11061106
1107-
<service
1108-
id="foo.twig.extension"
1109-
class="Acme\HelloBundle\Extension\FooExtension"
1110-
public="false">
1107+
<services>
1108+
<service
1109+
id="foo.twig.extension"
1110+
class="Acme\HelloBundle\Extension\FooExtension"
1111+
public="false">
11111112
1112-
<tag name="twig.extension" />
1113-
</service>
1113+
<tag name="twig.extension" />
1114+
</service>
1115+
</services>
11141116
</container>
11151117
11161118
.. code-block:: php

contributing/code/security.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ Security Advisories
103103
This section indexes security vulnerabilities that were fixed in Symfony
104104
releases, starting from Symfony 1.0.0:
105105

106+
* November 23, 2015: `CVE-2015-8125: Potential Remote Timing Attack Vulnerability in Security Remember-Me Service <http://symfony.com/blog/cve-2015-8125-potential-remote-timing-attack-vulnerability-in-security-remember-me-service>`_ (2.3.35, 2.6.12 and 2.7.7)
107+
* November 23, 2015: `CVE-2015-8124: Session Fixation in the "Remember Me" Login Feature <http://symfony.com/blog/cve-2015-8124-session-fixation-in-the-remember-me-login-feature>`_ (2.3.35, 2.6.12 and 2.7.7)
106108
* May 26, 2015: `CVE-2015-4050: ESI unauthorized access <https://symfony.com/blog/cve-2015-4050-esi-unauthorized-access>`_ (Symfony 2.3.29, 2.5.12 and 2.6.8)
107109
* April 1, 2015: `CVE-2015-2309: Unsafe methods in the Request class <https://symfony.com/blog/cve-2015-2309-unsafe-methods-in-the-request-class>`_ (Symfony 2.3.27, 2.5.11 and 2.6.6)
108110
* April 1, 2015: `CVE-2015-2308: Esi Code Injection <https://symfony.com/blog/cve-2015-2308-esi-code-injection>`_ (Symfony 2.3.27, 2.5.11 and 2.6.6)

cookbook/configuration/override_dir_structure.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ The change in the ``composer.json`` will look like this:
176176
...
177177
}
178178
179-
In ``app/autoload.php``, you need to modify the path leading to the
180-
``vendor/autoload.php`` file::
179+
Then, update the path to the ``autoload.php`` file in ``app/autoload.php``::
181180

182181
// app/autoload.php
183182
// ...

cookbook/doctrine/event_listeners_subscribers.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ a ``postPersist`` method, which will be called when the event is dispatched::
135135
public function postPersist(LifecycleEventArgs $args)
136136
{
137137
$entity = $args->getEntity();
138-
$entityManager = $args->getEntityManager();
139138

140-
// perhaps you only want to act on some "Product" entity
141-
if ($entity instanceof Product) {
142-
// ... do something with the Product
139+
// only act on some "Product" entity
140+
if (!$entity instanceof Product) {
141+
return;
143142
}
143+
144+
$entityManager = $args->getEntityManager();
145+
// ... do something with the Product
144146
}
145147
}
146148

@@ -197,10 +199,10 @@ interface and have an event method for each event it subscribes to::
197199
public function index(LifecycleEventArgs $args)
198200
{
199201
$entity = $args->getEntity();
200-
$entityManager = $args->getEntityManager();
201202

202203
// perhaps you only want to act on some "Product" entity
203204
if ($entity instanceof Product) {
205+
$entityManager = $args->getEntityManager();
204206
// ... do something with the Product
205207
}
206208
}

cookbook/form/dynamic_form_modification.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,26 @@ it with :ref:`dic-tags-form-type`.
411411
array('security.token_storage')
412412
);
413413
414-
If you wish to create it from within a controller or any other service that has
415-
access to the form factory, you then use::
414+
If you wish to create it from within a service that has access to the form factory,
415+
you then use::
416416

417-
use Symfony\Component\DependencyInjection\ContainerAware;
417+
$form = $formFactory->create('friend_message');
418418

419-
class FriendMessageController extends ContainerAware
419+
In a controller that extends the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`
420+
class, you can simply call::
421+
422+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
423+
424+
class FriendMessageController extends Controller
420425
{
421426
public function newAction(Request $request)
422427
{
423-
$form = $this->get('form.factory')->create('friend_message');
428+
$form = $this->createForm('friend_message');
424429

425430
// ...
426431
}
427432
}
428433

429-
If you extend the ``Symfony\Bundle\FrameworkBundle\Controller\Controller`` class, you can simply call::
430-
431-
$form = $this->createForm('friend_message');
432-
433434
You can also easily embed the form type into another form::
434435

435436
// inside some other "form type" class

cookbook/security/form_login_setup.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ In this entry, you'll build a traditional login form. Of course, when the
1212
user logs in, you can load your users from anywhere - like the database.
1313
See :ref:`security-user-providers` for details.
1414

15-
This chapter assumes that you've followed the beginning of the
16-
:doc:`security chapter </book/security>` and have ``http_basic`` authentication
17-
working properly.
18-
1915
First, enable form login under your firewall:
2016

2117
.. configuration-block::
@@ -29,7 +25,6 @@ First, enable form login under your firewall:
2925
firewalls:
3026
default:
3127
anonymous: ~
32-
http_basic: ~
3328
form_login:
3429
login_path: /login
3530
check_path: /login_check
@@ -47,7 +42,6 @@ First, enable form login under your firewall:
4742
<config>
4843
<firewall name="default">
4944
<anonymous />
50-
<http-basic />
5145
<form-login login-path="/login" check-path="/login_check" />
5246
</firewall>
5347
</config>
@@ -60,7 +54,6 @@ First, enable form login under your firewall:
6054
'firewalls' => array(
6155
'default' => array(
6256
'anonymous' => null,
63-
'http_basic' => null,
6457
'form_login' => array(
6558
'login_path' => '/login',
6659
'check_path' => '/login_check',

create_framework/dependency-injection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ them. Objects will be created on-demand when you access them from the
132132
container or when the container needs them to create other objects.
133133

134134
For instance, to create the router listener, we tell Symfony that its class
135-
name is ``Symfony\Component\HttpKernel\EventListener\RouterListener``, and
135+
name is ``Symfony\Component\HttpKernel\EventListener\RouterListener`` and
136136
that its constructor takes a matcher object (``new Reference('matcher')``). As
137137
you can see, each object is referenced by a name, a string that uniquely
138138
identifies each object. The name allows us to get an object and to reference

create_framework/event-dispatcher.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ event (``response``); the event name must be the same as the one used in the
154154
``dispatch()`` call.
155155

156156
In the listener, we add the Google Analytics code only if the response is not
157-
a redirection, if the requested format is HTML, and if the response content
157+
a redirection, if the requested format is HTML and if the response content
158158
type is HTML (these conditions demonstrate the ease of manipulating the
159159
Request and Response data from your code).
160160

0 commit comments

Comments
 (0)