Skip to content

Commit

Permalink
Merge branch '2.7'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
weaverryan committed Jul 7, 2015
2 parents 11237e7 + cc4c448 commit 6cc3445
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 29 deletions.
23 changes: 18 additions & 5 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ method::
You can also test a whole console application by using
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`.

.. _calling-existing-command:

Calling an Existing Command
---------------------------

Expand Down Expand Up @@ -506,16 +508,27 @@ Calling a command from another one is straightforward::
}

First, you :method:`Symfony\\Component\\Console\\Application::find` the
command you want to execute by passing the command name.

Then, you need to create a new
:class:`Symfony\\Component\\Console\\Input\\ArrayInput` with the arguments and
options you want to pass to the command.
command you want to execute by passing the command name. Then, you need to create
a new :class:`Symfony\\Component\\Console\\Input\\ArrayInput` with the arguments
and options you want to pass to the command.

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

.. tip::

If you want to suppress the output of the executed command, pass a
:class:`Symfony\\Component\\Console\\Output\\NullOutput` as the second
argument to ``$command->execute()``.

.. caution::

Note that all the commands will run in the same process and some of Symfony's
built-in commands may not work well this way. For instance, the ``cache:clear``
and ``cache:warmup`` commands change some class definitions, so running
something after them is likely to break.

.. note::

Most of the time, calling a command from code that is not executed on the
Expand Down
6 changes: 6 additions & 0 deletions cookbook/console/console_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ before translating contents::
However for other services the solution might be more complex. For more details,
see :doc:`/cookbook/service_container/scopes`.

Invoking other Commands
-----------------------

See :ref:`calling-existing-command` if you need to implement a command that runs
other dependent commands.

Testing Commands
----------------

Expand Down
23 changes: 13 additions & 10 deletions cookbook/map.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,13 @@
* :doc:`/cookbook/routing/redirect_trailing_slash`
* :doc:`/cookbook/routing/extra_information`

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

* :doc:`/cookbook/security/form_login_setup`
* :doc:`/cookbook/security/entity_provider`
* :doc:`/cookbook/security/remember_me`
* :doc:`/cookbook/security/impersonating_user`
* :doc:`/cookbook/security/voters`
* :doc:`/cookbook/security/voters_data_permission`
* :doc:`/cookbook/security/acl`
* :doc:`/cookbook/security/acl_advanced`
* :doc:`/cookbook/security/force_https`
* :doc:`/cookbook/security/firewall_restriction`
* :doc:`/cookbook/security/host_restriction`
* :doc:`/cookbook/security/form_login`
* :doc:`/cookbook/security/securing_services`
* :doc:`/cookbook/security/custom_provider`
* :doc:`/cookbook/security/custom_password_authenticator`
* :doc:`/cookbook/security/api_key_authentication`
Expand All @@ -178,8 +170,19 @@
* :doc:`/cookbook/security/target_path`
* :doc:`/cookbook/security/csrf_in_login_form`
* :doc:`/cookbook/security/named_encoders`
* :doc:`/cookbook/security/access_control`
* :doc:`/cookbook/security/multiple_user_providers`
* :doc:`/cookbook/security/firewall_restriction`
* :doc:`/cookbook/security/host_restriction`

* :doc:`Security Authorization (Denying Access) </cookbook/security/index>`

* :doc:`/cookbook/security/voters`
* :doc:`/cookbook/security/voters_data_permission`
* :doc:`/cookbook/security/acl`
* :doc:`/cookbook/security/acl_advanced`
* :doc:`/cookbook/security/force_https`
* :doc:`/cookbook/security/securing_services`
* :doc:`/cookbook/security/access_control`

* **Serializer**

Expand Down
28 changes: 19 additions & 9 deletions cookbook/security/index.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
Security
========

Authentication (Identifying/Logging in the User)
------------------------------------------------

.. toctree::
:maxdepth: 2

form_login_setup
entity_provider
remember_me
impersonating_user
voters
voters_data_permission
acl
acl_advanced
force_https
firewall_restriction
host_restriction
form_login
securing_services
custom_provider
custom_password_authenticator
api_key_authentication
Expand All @@ -25,5 +20,20 @@ Security
target_path
csrf_in_login_form
named_encoders
access_control
multiple_user_providers
firewall_restriction
host_restriction

Authorization (Denying Access)
------------------------------

.. toctree::
:maxdepth: 2

voters
voters_data_permission
acl
acl_advanced
force_https
securing_services
access_control
4 changes: 4 additions & 0 deletions cookbook/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Here is an example on how to load the
$definition->addTag('serializer.normalizer');
$container->setDefinition('get_set_method_normalizer', $definition);
.. _cookbook-serializer-using-serialization-groups-annotations:

Using Serialization Groups Annotations
--------------------------------------

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

.. _cookbook-serializer-enabling-metadata-cache:

Enabling the Metadata Cache
---------------------------

Expand Down
5 changes: 5 additions & 0 deletions create_framework/unit-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ We are now ready to write our first test::
->method('match')
->will($this->throwException($exception))
;
$matcher
->expects($this->once())
->method('getContext')
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext')))
;
$resolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');

return new Framework($matcher, $resolver);
Expand Down
33 changes: 31 additions & 2 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Configuration
* `validation`_
* :ref:`enabled <reference-validation-enabled>`
* :ref:`cache <reference-validation-cache>`
* `enable_annotations`_
* :ref:`enable_annotations <reference-validation-enable_annotations>`
* `translation_domain`_
* `strict_email`_
* `api`_
Expand All @@ -102,6 +102,8 @@ Configuration
* `debug`_
* `serializer`_
* :ref:`enabled <reference-serializer-enabled>`
* :ref:`cache <reference-serializer-cache>`
* :ref:`enable_annotations <reference-serializer-enable_annotations>`

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

.. _reference-validation-enable_annotations:

enable_annotations
..................

Expand Down Expand Up @@ -1485,7 +1489,32 @@ enabled

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

For more details, see :doc:`/cookbook/serializer`.
.. _reference-serializer-cache:

cache
.....

**type**: ``string``

The service that is used to persist class metadata in a cache. The service
has to implement the :class:`Doctrine\\Common\\Cache\\Cache` interface.

.. seealso::

For more information, see :ref:`cookbook-serializer-enabling-metadata-cache`.

.. _reference-serializer-enable_annotations:

enable_annotations
..................

**type**: ``boolean`` **default**: ``false``

If this option is enabled, serialization groups can be defined using annotations.

.. seealso::

For more information, see :ref:`cookbook-serializer-using-serialization-groups-annotations`.

Full Default Configuration
--------------------------
Expand Down
Loading

0 comments on commit 6cc3445

Please sign in to comment.