Skip to content

Commit 6cc3445

Browse files
committed
Merge branch '2.7'
* 2.7: [symfony#5426] Porting the checkDNS option to 2.7 only Reordered the configuration blocks of the first example Fixed some errors and made some simplifications Added the "payload" option back (was removed by mistake) Fixed the order of the examples Simplified the first example and added more examples [Validator] Updated documentation of URL validator Fixed typos Removed duplication and moved a caution message [Console] Added a cookbook entry on invoking other commands [symfony#5367] Making the titles more searchable fix symfony#5487 [FrameworkBundle] Update serializer configuration reference Changed Authorization and Authentication to use subsections Split Security into Authentication & Authorization
2 parents 11237e7 + cc4c448 commit 6cc3445

File tree

8 files changed

+306
-29
lines changed

8 files changed

+306
-29
lines changed

Diff for: components/console/introduction.rst

+18-5
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ method::
477477
You can also test a whole console application by using
478478
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`.
479479

480+
.. _calling-existing-command:
481+
480482
Calling an Existing Command
481483
---------------------------
482484

@@ -506,16 +508,27 @@ Calling a command from another one is straightforward::
506508
}
507509

508510
First, you :method:`Symfony\\Component\\Console\\Application::find` the
509-
command you want to execute by passing the command name.
510-
511-
Then, you need to create a new
512-
:class:`Symfony\\Component\\Console\\Input\\ArrayInput` with the arguments and
513-
options you want to pass to the command.
511+
command you want to execute by passing the command name. Then, you need to create
512+
a new :class:`Symfony\\Component\\Console\\Input\\ArrayInput` with the arguments
513+
and options you want to pass to the command.
514514

515515
Eventually, calling the ``run()`` method actually executes the command and
516516
returns the returned code from the command (return value from command's
517517
``execute()`` method).
518518

519+
.. tip::
520+
521+
If you want to suppress the output of the executed command, pass a
522+
:class:`Symfony\\Component\\Console\\Output\\NullOutput` as the second
523+
argument to ``$command->execute()``.
524+
525+
.. caution::
526+
527+
Note that all the commands will run in the same process and some of Symfony's
528+
built-in commands may not work well this way. For instance, the ``cache:clear``
529+
and ``cache:warmup`` commands change some class definitions, so running
530+
something after them is likely to break.
531+
519532
.. note::
520533

521534
Most of the time, calling a command from code that is not executed on the

Diff for: cookbook/console/console_command.rst

+6
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ before translating contents::
159159
However for other services the solution might be more complex. For more details,
160160
see :doc:`/cookbook/service_container/scopes`.
161161

162+
Invoking other Commands
163+
-----------------------
164+
165+
See :ref:`calling-existing-command` if you need to implement a command that runs
166+
other dependent commands.
167+
162168
Testing Commands
163169
----------------
164170

Diff for: cookbook/map.rst.inc

+13-10
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,13 @@
155155
* :doc:`/cookbook/routing/redirect_trailing_slash`
156156
* :doc:`/cookbook/routing/extra_information`
157157

158-
* :doc:`/cookbook/security/index`
158+
* :doc:`Security Authentication (Identifying/Logging in the User) </cookbook/security/index>`
159159

160160
* :doc:`/cookbook/security/form_login_setup`
161161
* :doc:`/cookbook/security/entity_provider`
162162
* :doc:`/cookbook/security/remember_me`
163163
* :doc:`/cookbook/security/impersonating_user`
164-
* :doc:`/cookbook/security/voters`
165-
* :doc:`/cookbook/security/voters_data_permission`
166-
* :doc:`/cookbook/security/acl`
167-
* :doc:`/cookbook/security/acl_advanced`
168-
* :doc:`/cookbook/security/force_https`
169-
* :doc:`/cookbook/security/firewall_restriction`
170-
* :doc:`/cookbook/security/host_restriction`
171164
* :doc:`/cookbook/security/form_login`
172-
* :doc:`/cookbook/security/securing_services`
173165
* :doc:`/cookbook/security/custom_provider`
174166
* :doc:`/cookbook/security/custom_password_authenticator`
175167
* :doc:`/cookbook/security/api_key_authentication`
@@ -178,8 +170,19 @@
178170
* :doc:`/cookbook/security/target_path`
179171
* :doc:`/cookbook/security/csrf_in_login_form`
180172
* :doc:`/cookbook/security/named_encoders`
181-
* :doc:`/cookbook/security/access_control`
182173
* :doc:`/cookbook/security/multiple_user_providers`
174+
* :doc:`/cookbook/security/firewall_restriction`
175+
* :doc:`/cookbook/security/host_restriction`
176+
177+
* :doc:`Security Authorization (Denying Access) </cookbook/security/index>`
178+
179+
* :doc:`/cookbook/security/voters`
180+
* :doc:`/cookbook/security/voters_data_permission`
181+
* :doc:`/cookbook/security/acl`
182+
* :doc:`/cookbook/security/acl_advanced`
183+
* :doc:`/cookbook/security/force_https`
184+
* :doc:`/cookbook/security/securing_services`
185+
* :doc:`/cookbook/security/access_control`
183186

184187
* **Serializer**
185188

Diff for: cookbook/security/index.rst

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
Security
22
========
33

4+
Authentication (Identifying/Logging in the User)
5+
------------------------------------------------
6+
47
.. toctree::
58
:maxdepth: 2
69

710
form_login_setup
811
entity_provider
912
remember_me
1013
impersonating_user
11-
voters
12-
voters_data_permission
13-
acl
14-
acl_advanced
15-
force_https
16-
firewall_restriction
17-
host_restriction
1814
form_login
19-
securing_services
2015
custom_provider
2116
custom_password_authenticator
2217
api_key_authentication
@@ -25,5 +20,20 @@ Security
2520
target_path
2621
csrf_in_login_form
2722
named_encoders
28-
access_control
2923
multiple_user_providers
24+
firewall_restriction
25+
host_restriction
26+
27+
Authorization (Denying Access)
28+
------------------------------
29+
30+
.. toctree::
31+
:maxdepth: 2
32+
33+
voters
34+
voters_data_permission
35+
acl
36+
acl_advanced
37+
force_https
38+
securing_services
39+
access_control

Diff for: cookbook/serializer.rst

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Here is an example on how to load the
124124
$definition->addTag('serializer.normalizer');
125125
$container->setDefinition('get_set_method_normalizer', $definition);
126126
127+
.. _cookbook-serializer-using-serialization-groups-annotations:
128+
127129
Using Serialization Groups Annotations
128130
--------------------------------------
129131

@@ -170,6 +172,8 @@ to your class and choose which groups to use when serializing::
170172
'json', array('groups' => array('group1')
171173
);
172174

175+
.. _cookbook-serializer-enabling-metadata-cache:
176+
173177
Enabling the Metadata Cache
174178
---------------------------
175179

Diff for: create_framework/unit-testing.rst

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ We are now ready to write our first test::
9696
->method('match')
9797
->will($this->throwException($exception))
9898
;
99+
$matcher
100+
->expects($this->once())
101+
->method('getContext')
102+
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext')))
103+
;
99104
$resolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');
100105

101106
return new Framework($matcher, $resolver);

Diff for: reference/configuration/framework.rst

+31-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Configuration
9292
* `validation`_
9393
* :ref:`enabled <reference-validation-enabled>`
9494
* :ref:`cache <reference-validation-cache>`
95-
* `enable_annotations`_
95+
* :ref:`enable_annotations <reference-validation-enable_annotations>`
9696
* `translation_domain`_
9797
* `strict_email`_
9898
* `api`_
@@ -102,6 +102,8 @@ Configuration
102102
* `debug`_
103103
* `serializer`_
104104
* :ref:`enabled <reference-serializer-enabled>`
105+
* :ref:`cache <reference-serializer-cache>`
106+
* :ref:`enable_annotations <reference-serializer-enable_annotations>`
105107

106108
secret
107109
~~~~~~
@@ -1379,6 +1381,8 @@ has to implement the :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\Cach
13791381
Set this option to ``validator.mapping.cache.doctrine.apc`` to use the APC
13801382
cache provide from the Doctrine project.
13811383

1384+
.. _reference-validation-enable_annotations:
1385+
13821386
enable_annotations
13831387
..................
13841388

@@ -1485,7 +1489,32 @@ enabled
14851489

14861490
Whether to enable the ``serializer`` service or not in the service container.
14871491

1488-
For more details, see :doc:`/cookbook/serializer`.
1492+
.. _reference-serializer-cache:
1493+
1494+
cache
1495+
.....
1496+
1497+
**type**: ``string``
1498+
1499+
The service that is used to persist class metadata in a cache. The service
1500+
has to implement the :class:`Doctrine\\Common\\Cache\\Cache` interface.
1501+
1502+
.. seealso::
1503+
1504+
For more information, see :ref:`cookbook-serializer-enabling-metadata-cache`.
1505+
1506+
.. _reference-serializer-enable_annotations:
1507+
1508+
enable_annotations
1509+
..................
1510+
1511+
**type**: ``boolean`` **default**: ``false``
1512+
1513+
If this option is enabled, serialization groups can be defined using annotations.
1514+
1515+
.. seealso::
1516+
1517+
For more information, see :ref:`cookbook-serializer-using-serialization-groups-annotations`.
14891518

14901519
Full Default Configuration
14911520
--------------------------

0 commit comments

Comments
 (0)