Skip to content

Commit 81f2a0a

Browse files
committed
Merge branch '4.0'
* 4.0: (32 commits) [#8928] Fixing a few more bad XML routes Added Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator Reworded the note about supressing form validation [PropertyInfo] Fixed doc about PhpDocExtractor use ValidatorInterface Update file_permissions.rst Update setup.rst How to use the route in xml adding install details about annotations in the routing chapter Removed an unneeded note in the Lock docs Fixed a grammar error Update web_server_configuration.rst Replaced class per id in service definition in XML Update http_foundation.rst bundles.rst: Conflict resolving clean up fix typo the_architecture.rst Update the_big_picture.rst add validator dependency Update flex_recipes.rst Minor reword. ...
2 parents 6556f49 + 1865baf commit 81f2a0a

32 files changed

+202
-259
lines changed

_build/redirection_map

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
/cookbook/console/style /console/style
125125
/cookbook/console/usage /console
126126
/console/usage /console
127-
/cookbook/controller/csrf_token_validation /controller/csrf_token_validation
127+
/cookbook/controller/csrf_token_validation /security/csrf
128128
/cookbook/controller/error_pages /controller/error_pages
129129
/cookbook/controller/forwarding /controller/forwarding
130130
/cookbook/controller/index /controller
@@ -221,7 +221,7 @@
221221
/cookbook/security/acl /security/acl
222222
/cookbook/security/acl_advanced /security/acl_advanced
223223
/cookbook/security/api_key_authentication /security/api_key_authentication
224-
/cookbook/security/csrf_in_login_form /security/csrf_in_login_form
224+
/cookbook/security/csrf_in_login_form /security/csrf
225225
/cookbook/security/custom_authentication_provider /security/custom_authentication_provider
226226
/cookbook/security/custom_password_authenticator /security/custom_password_authenticator
227227
/cookbook/security/custom_provider /security/custom_provider
@@ -361,7 +361,9 @@
361361
/components/yaml/introduction /components/yaml
362362
/components/yaml/index /components/yaml
363363
/console/logging /console
364+
/controller/csrf_token_validation /security/csrf
364365
/deployment/tools /deployment
366+
/form/csrf_protection /security/csrf
365367
/install/bundles /setup/bundles
366368
/email/gmail /email
367369
/email/cloud /email
@@ -376,6 +378,7 @@
376378
/frontend/assetic/yuicompressor /frontend/assetic
377379
/reference/configuration/assetic /frontend/assetic
378380
/security/target_path /security
381+
/security/csrf_in_login_form /security/csrf
379382
/service_container/third_party /service_container
380383
/templating/templating_service /templates
381384
/testing/simulating_authentication /testing/http_authentication

bundles.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ As you move through the guides, you'll learn how to persist objects to a
151151
database, create and validate forms, create translations for your application,
152152
write tests and much more. Each of these has their own place and role within
153153
the bundle.
154-
>>>>>>> 3.4
155154

156155
Learn more
157156
----------

components/lock.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ The Lock Component
88
The Lock Component creates and manages `locks`_, a mechanism to provide
99
exclusive access to a shared resource.
1010

11-
.. versionadded:: 3.4
12-
The Lock component was introduced in Symfony 3.4.
13-
1411
Installation
1512
------------
1613

components/process.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -258,38 +258,6 @@ instead::
258258
);
259259
$process->run();
260260

261-
To make your code work better on all platforms, you might want to use the
262-
:class:`Symfony\\Component\\Process\\ProcessBuilder` class instead::
263-
264-
use Symfony\Component\Process\ProcessBuilder;
265-
266-
$builder = new ProcessBuilder(array('ls', '-lsa'));
267-
$builder->getProcess()->run();
268-
269-
In case you are building a binary driver, you can use the
270-
:method:`Symfony\\Component\\Process\\ProcessBuilder::setPrefix` method to prefix all
271-
the generated process commands.
272-
273-
The following example will generate two process commands for a tar binary
274-
adapter::
275-
276-
use Symfony\Component\Process\ProcessBuilder;
277-
278-
$builder = new ProcessBuilder();
279-
$builder->setPrefix('/usr/bin/tar');
280-
281-
// '/usr/bin/tar' '--list' '--file=archive.tar.gz'
282-
echo $builder
283-
->setArguments(array('--list', '--file=archive.tar.gz'))
284-
->getProcess()
285-
->getCommandLine();
286-
287-
// '/usr/bin/tar' '-xzf' 'archive.tar.gz'
288-
echo $builder
289-
->setArguments(array('-xzf', 'archive.tar.gz'))
290-
->getProcess()
291-
->getCommandLine();
292-
293261
Process Timeout
294262
---------------
295263

components/property_info.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ PhpDocExtractor
379379

380380
.. note::
381381

382-
This extractor depends on the `phpdocumentor/reflection`_ library.
382+
This extractor depends on the `phpdocumentor/reflection-docblock`_ library.
383383

384384
Using `phpDocumentor Reflection`_ to parse property and method annotations,
385385
the :class:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor`
@@ -481,8 +481,8 @@ service by defining it as a service with one or more of the following
481481
* ``property_info.access_extractor`` if it provides access information.
482482

483483
.. _Packagist: https://packagist.org/packages/symfony/property-info
484-
.. _`phpDocumentor Reflection`: https://github.com/phpDocumentor/Reflection
485-
.. _`phpdocumentor/reflection`: https://packagist.org/packages/phpdocumentor/reflection
484+
.. _`phpDocumentor Reflection`: https://github.com/phpDocumentor/ReflectionDocBlock
485+
.. _`phpdocumentor/reflection-docblock`: https://packagist.org/packages/phpdocumentor/reflection-docblock
486486
.. _`Doctrine ORM`: http://www.doctrine-project.org/projects/orm.html
487487
.. _`symfony/serializer`: https://packagist.org/packages/symfony/serializer
488488
.. _`symfony/doctrine-bridge`: https://packagist.org/packages/symfony/doctrine-bridge

components/var_dumper.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ current PHP SAPI:
7979
DebugBundle and Twig Integration
8080
--------------------------------
8181

82-
The DebugBundle allows greater integration of the component into the Symfony
83-
full-stack framework. It is enabled by default in the *dev* and *test*
84-
environment of the Symfony Standard Edition.
82+
The DebugBundle allows greater integration of this component into Symfony
83+
applications.
8584

8685
Since generating (even debug) output in the controller or in the model
8786
of your application may just break it by e.g. sending HTTP headers or

configuration/external_parameters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ put in a ``DATABASE_URL`` environment variable:
2929
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name"
3030
3131
This variable is referenced in the service container configuration using
32-
``%env(DATABASE_HOST)%``:
32+
``%env(DATABASE_URL)%``:
3333

3434
.. configuration-block::
3535

configuration/multiple_kernels.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How To Create Symfony Applications with Multiple Kernels
66

77
.. caution::
88

9-
Creating aplications with multiple kernels is no longer recommended by
9+
Creating applications with multiple kernels is no longer recommended by
1010
Symfony. Consider creating multiple small applications instead.
1111

1212
In most Symfony applications, incoming requests are processed by the

controller/csrf_token_validation.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

create_framework/http_foundation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ the wheel.
285285

286286
I've almost forgot to talk about one added benefit: using the HttpFoundation
287287
component is the start of better interoperability between all frameworks and
288-
applications using it (like `Symfony`_, `Drupal 8`_, `phpBB 4`_, `ezPublish
288+
applications using it (like `Symfony`_, `Drupal 8`_, `phpBB 3`_, `ezPublish
289289
5`_, `Laravel`_, `Silex`_ and `more`_).
290290

291291
.. _`Twig`: http://twig.sensiolabs.org/
292292
.. _`HTTP specification`: http://tools.ietf.org/wg/httpbis/
293293
.. _`audited`: https://symfony.com/blog/symfony2-security-audit
294294
.. _`Symfony`: https://symfony.com/
295295
.. _`Drupal 8`: https://drupal.org/
296-
.. _`phpBB 4`: https://www.phpbb.com/
296+
.. _`phpBB 3`: https://www.phpbb.com/
297297
.. _`ezPublish 5`: http://ez.no/
298298
.. _`Laravel`: http://laravel.com/
299299
.. _`Silex`: http://silex.sensiolabs.org/

doctrine/registration_form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ First, make sure you have all the dependencies you need installed:
1414

1515
.. code-block:: terminal
1616
17-
$ composer require doctrine form security
17+
$ composer require doctrine form security validator
1818
1919
.. tip::
2020

form/csrf_protection.rst

Lines changed: 0 additions & 74 deletions
This file was deleted.

form/dynamic_form_modification.rst

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -620,30 +620,5 @@ code from above to generate the submitted form can be reused.
620620
Suppressing Form Validation
621621
---------------------------
622622

623-
To suppress form validation you can use the ``POST_SUBMIT`` event and prevent
624-
the :class:`Symfony\\Component\\Form\\Extension\\Validator\\EventListener\\ValidationListener`
625-
from being called.
626-
627-
The reason for needing to do this is that even if you set ``validation_groups``
628-
to ``false`` there are still some integrity checks executed. For example
629-
an uploaded file will still be checked to see if it is too large and the form
630-
will still check to see if non-existing fields were submitted. To disable
631-
all of this, use a listener::
632-
633-
use Symfony\Component\Form\FormBuilderInterface;
634-
use Symfony\Component\Form\FormEvents;
635-
use Symfony\Component\Form\FormEvent;
636-
637-
public function buildForm(FormBuilderInterface $builder, array $options)
638-
{
639-
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
640-
$event->stopPropagation();
641-
}, 900); // Always set a higher priority than ValidationListener
642-
643-
// ...
644-
}
645-
646-
.. caution::
647-
648-
By doing this, you may accidentally disable something more than just form
649-
validation, since the ``POST_SUBMIT`` event may have other listeners.
623+
To suppress form validation, set ``validation_groups`` to ``false`` or an empty
624+
array.

forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ That's it! Just three lines are needed to render the complete form:
188188
Renders the end tag of the form and any fields that have not
189189
yet been rendered, in case you rendered each field yourself. This is useful
190190
for rendering hidden fields and taking advantage of the automatic
191-
:doc:`CSRF Protection </form/csrf_protection>`.
191+
:doc:`CSRF Protection </security/csrf>`.
192192

193193
.. seealso::
194194

http_cache/form_csrf_caching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CSRF tokens are meant to be different for every user. This is why you
88
need to be cautious if you try to cache pages with forms including them.
99

1010
For more information about how CSRF protection works in Symfony, please
11-
check :doc:`CSRF Protection </form/csrf_protection>`.
11+
check :doc:`CSRF Protection </security/csrf>`.
1212

1313
Why Caching Pages with a CSRF token is Problematic
1414
--------------------------------------------------

http_cache/varnish.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you know for sure that the backend never uses sessions or basic
6262
authentication, have Varnish remove the corresponding header from requests to
6363
prevent clients from bypassing the cache. In practice, you will need sessions
6464
at least for some parts of the site, e.g. when using forms with
65-
:doc:`CSRF Protection </form/csrf_protection>`. In this situation, make sure to
65+
:doc:`CSRF Protection </security/csrf>`. In this situation, make sure to
6666
:doc:`only start a session when actually needed </session/avoid_session_start>`
6767
and clear the session when it is no longer needed. Alternatively, you can look
6868
into :doc:`/http_cache/form_csrf_caching`.

profiler/data_collector.rst

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,43 @@ Creating a custom data collector is as simple as implementing the
1717
interface DataCollectorInterface
1818
{
1919
function collect(Request $request, Response $response, \Exception $exception = null);
20+
public function reset();
2021
function getName();
2122
}
2223

23-
The
24-
:method:`Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface::getName`
25-
method returns the name of the data collector and must be unique in the
26-
application. This value is also used to access the information later on (see
27-
:doc:`/testing/profiling` for instance).
24+
The :method:`Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface::getName`
25+
method returns the collector identifier, which must be unique in the
26+
application. You can choose any arbitrary name, but it's recommended to return
27+
a string which is short, lowercased and without white spaces, because this value
28+
is used later to access the collector information (see :doc:`/testing/profiling`
29+
for instance).
30+
31+
The :method:`Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface::reset`
32+
method is called between requests to reset the state of the profiler. Use it to
33+
remove all the information collected with the ``collect()`` method::
34+
35+
// src/DataCollector/RequestCollector.php
36+
namespace App\DataCollector;
37+
38+
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
39+
use Symfony\Component\HttpFoundation\Request;
40+
use Symfony\Component\HttpFoundation\Response;
41+
42+
class RequestCollector extends DataCollector
43+
{
44+
public function collect(Request $request, Response $response, \Exception $exception = null)
45+
{
46+
// this method saves some information in $this->data
47+
// ...
48+
}
49+
50+
public function reset()
51+
{
52+
// if the data collector is more complex, here you can call other
53+
// services to reset their states or data
54+
$this->data = array();
55+
}
56+
}
2857

2958
The
3059
:method:`Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface::collect`

quick_tour/flex_recipes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ rich API for a ``product`` table? Create a ``Product`` entity and give it the
179179
// ...
180180

181181
use ApiPlatform\Core\Annotation\ApiResource;
182+
use Doctrine\ORM\Mapping as ORM;
182183

183184
/**
184185
* @ORM\Entity()

quick_tour/the_architecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Twig Extension & Autoconfiguration
135135
----------------------------------
136136

137137
Thanks to Symfony's service handling, you can *extend* Symfony in many ways, like
138-
by creating an event subscriber or or a security voter for complex authorization
138+
by creating an event subscriber or a security voter for complex authorization
139139
rules. Let's add a new filter to Twig called ``greet``. How? Just create a class
140140
that extends ``AbstractExtension``::
141141

quick_tour/the_big_picture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Install and run it with:
4747

4848
.. code-block:: terminal
4949
50-
$ composer require server
50+
$ composer require server --dev
5151
$ php bin/console server:start
5252
5353
Try your new app by going to ``http://localhost:8000`` in a browser!

0 commit comments

Comments
 (0)