Skip to content

Commit

Permalink
Merge branch '2.7'
Browse files Browse the repository at this point in the history
* 2.7: (31 commits)
  fix merge after removing @Security in 2.3
  Reverting a commit on 2.5 branch, as it was only meant to be on 2.3 (so reverting after the merge)
  [#4735] Reverting what was left on the 2.5 branch after the merge conflict had already put back some of it
  Typo Fix: "allows to" should be "allows you to"
  Adding a link to log things in the prod environment
  [#4857] Adding missing word thanks to xabbuh
  move cautions to make them visible
  Fixing bad english thanks to xabbuh
  Adding missing words thanks to javiereguiluz
  language tweak thanks to xabbuh!
  Adding an example image of the debug_formatter
  [#4643] Minor english changes to make things even smoother (though they were correct before)
  replace API link for SwiftmailerBundle
  Update security.rst
  Update routing.rst
  don't output message from AuthenticationException
  Add custom link labels where Cookbook articles titles looked wrong
  Fix typo: BLOG => BLOB
  Fix code example
  Removed a leftover comma in security config sample
  ...
  • Loading branch information
weaverryan committed Jan 18, 2015
2 parents a17bdd7 + 7363c9b commit 907ee0d
Show file tree
Hide file tree
Showing 126 changed files with 678 additions and 922 deletions.
4 changes: 2 additions & 2 deletions best_practices/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ add an extra layer of configuration that's not needed because you don't need
or want these configuration values to change on each server.

The configuration options defined in the ``config.yml`` file usually vary from
one :doc:`/cookbook/configuration/environments` to another. That's why Symfony
already includes ``app/config/config_dev.yml`` and ``app/config/config_prod.yml``
one :doc:`environment </cookbook/configuration/environments>` to another. That's
why Symfony already includes ``app/config/config_dev.yml`` and ``app/config/config_prod.yml``
files so that you can override specific values for each environment.

Constants vs Configuration Options
Expand Down
5 changes: 3 additions & 2 deletions best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ For example:
use AppBundle\Entity\Post;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
/**
* @Route("/{id}", name="admin_post_show")
*/
Expand Down Expand Up @@ -212,6 +212,7 @@ Pre and Post Hooks
------------------

If you need to execute some code before or after the execution of your controllers,
you can use the EventDispatcher component to :doc:`/cookbook/event_dispatcher/before_after_filters`.
you can use the EventDispatcher component to
:doc:`set up before and after filters </cookbook/event_dispatcher/before_after_filters>`.

.. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
5 changes: 3 additions & 2 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ fields:

If you need more control over how your fields are rendered, then you should
remove the ``form_widget(form)`` function and render your fields individually.
See :doc:`/cookbook/form/form_customization` for more information on this and how
you can control *how* the form renders at a global level using form theming.
See the :doc:`/cookbook/form/form_customization` article for more information
on this and how you can control *how* the form renders at a global level
using form theming.

Handling Form Submits
---------------------
Expand Down
2 changes: 2 additions & 0 deletions best_practices/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ Now you can reuse this method both in the template and in the security expressio
{% endif %}

.. _best-practices-directly-isGranted:
.. _checking-permissions-without-security:
.. _manually-checking-permissions:

Checking Permissions without @Security
--------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,6 @@ content that's sent back to the client::
$response = new Response(json_encode(array('name' => $name)));
$response->headers->set('Content-Type', 'application/json');

.. versionadded:: 2.4
Support for HTTP status code constants was introduced in Symfony 2.4.

The ``headers`` property is a :class:`Symfony\\Component\\HttpFoundation\\HeaderBag`
object and has some nice methods for getting and setting the headers. The
header names are normalized so that using ``Content-Type`` is equivalent to
Expand Down
3 changes: 0 additions & 3 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,6 @@ the HTTP response being returned. Use them to improve the blog:
// echo the headers and send the response
$response->send();

.. versionadded:: 2.4
Support for HTTP status code constants was introduced in Symfony 2.4.

The controllers are now responsible for returning a ``Response`` object.
To make this easier, you can add a new ``render_template()`` function, which,
incidentally, acts quite a bit like the Symfony templating engine:
Expand Down
3 changes: 0 additions & 3 deletions book/http_fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ interface to construct the response that needs to be returned to the client::
// prints the HTTP headers followed by the content
$response->send();

.. versionadded:: 2.4
Support for HTTP status code constants was introduced in Symfony 2.4.

If Symfony offered nothing else, you would already have a toolkit for easily
accessing request information and an object-oriented interface for creating
the response. Even as you learn the many powerful features in Symfony, keep
Expand Down
4 changes: 0 additions & 4 deletions book/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ processing must only occur on the master request).
Events
~~~~~~

.. versionadded:: 2.4
The ``isMasterRequest()`` method was introduced in Symfony 2.4.
Prior, the ``getRequestType()`` method must be used.

Each event thrown by the Kernel is a subclass of
:class:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent`. This means that
each event has access to the same basic information:
Expand Down
5 changes: 1 addition & 4 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ be added for each parameter. For example:

.. configuration-block::

.. code-block:: php
.. code-block:: php-annotations
// src/AppBundle/Controller/BlogController.php
Expand Down Expand Up @@ -915,9 +915,6 @@ component documentation.
Completely Customized Route Matching with Conditions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.4
Route conditions were introduced in Symfony 2.4.

As you've seen, a route can be made to match only certain routing wildcards
(via regular expressions), HTTP methods, or host names. But the routing system
can be extended to have an almost infinite flexibility using ``conditions``:
Expand Down
15 changes: 2 additions & 13 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Security
========

Symfony's security system is incredibly powerful, but it can also be confusing
to setup. In this chapter, you'll learn how to setup your application's security
to set up. In this chapter, you'll learn how to set up your application's security
step-by-step, from configuring your firewall and how you load users to denying
access and fetching the User object. Depending on what you need, sometimes
the initial setup can be tough. But once it's done, Symfony's security system
Expand Down Expand Up @@ -300,7 +300,7 @@ provider, but it's better to think of it as an "in configuration" provider:
memory:
users:
ryan:
password: ryanpass,
password: ryanpass
roles: 'ROLE_USER'
admin:
password: kitten
Expand Down Expand Up @@ -808,9 +808,6 @@ You can easily deny access from inside a controller::
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.

.. versionadded:: 2.5
The ``createAccessDeniedException`` method was introduced in Symfony 2.5.

The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::createAccessDeniedException`
method creates a special :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
object, which ultimately triggers a 403 HTTP response inside Symfony.
Expand Down Expand Up @@ -925,9 +922,6 @@ special attributes like this:

.. _book-security-template-expression:

.. versionadded:: 2.4
The ``expression`` functionality was introduced in Symfony 2.4.

You can also use expressions inside your templates:

.. configuration-block::
Expand Down Expand Up @@ -1304,11 +1298,6 @@ cookie will be ever created by Symfony):
Checking for Known Security Vulnerabilities in Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.5
The ``security:check`` command was introduced in Symfony 2.5. This command is
included in ``SensioDistributionBundle``, which has to be registered in your
application in order to use this command.

When using lots of dependencies in your Symfony projects, some of them may
contain security vulnerabilities. That's why Symfony includes a command called
``security:check`` that checks your ``composer.lock`` file to find any known
Expand Down
6 changes: 0 additions & 6 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,6 @@ the work of instantiating the classes.
Using the Expression Language
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.4
The Expression Language functionality was introduced in Symfony 2.4.

The service container also supports an "expression" that allows you to inject
very specific values into a service.

Expand Down Expand Up @@ -818,9 +815,6 @@ Injecting the dependency by the setter method just needs a change of syntax:
Injecting the Request
~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.4
The ``request_stack`` service was introduced in Symfony 2.4.

As of Symfony 2.4, instead of injecting the ``request`` service, you should
inject the ``request_stack`` service and access the ``Request`` by calling
the :method:`Symfony\\Component\\HttpFoundation\\RequestStack::getCurrentRequest`
Expand Down
6 changes: 0 additions & 6 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,6 @@ configuration option.

.. _`book-templating-version-by-asset`:

.. versionadded:: 2.5
Setting versioned URLs on an asset-by-asset basis was introduced in Symfony 2.5.

If you need to set a version for a specific asset, you can set the fourth
argument (or the ``version`` argument) to the desired version:

Expand All @@ -1046,9 +1043,6 @@ If you don't give a version or pass ``null``, the default package version
(from :ref:`ref-framework-assets-version`) will be used. If you pass ``false``,
versioned URL will be deactivated for this asset.

.. versionadded:: 2.5
Absolute URLs for assets were introduced in Symfony 2.5.

If you need absolute URLs for assets, you can set the third argument (or the
``absolute`` argument) to ``true``:

Expand Down
4 changes: 2 additions & 2 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ it has its own excellent `documentation`_.

.. note::

Symfony works with PHPUnit 3.5.11 or later, though version 3.6.4 is
needed to test the Symfony core code itself.
It's recommended to use the latest stable PHPUnit version (you will have
to use version 4.2 or higher to test the Symfony core code itself).

Each test - whether it's a unit test or a functional test - is a PHP class
that should live in the ``Tests/`` subdirectory of your bundles. If you follow
Expand Down
3 changes: 0 additions & 3 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,6 @@ see the documentation for these libraries.
Debugging Translations
----------------------

.. versionadded:: 2.5
The ``debug:translation`` command was introduced in Symfony 2.5.

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``translation:debug``.

Expand Down
3 changes: 0 additions & 3 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,6 @@ allows you to add a constraint to any public method whose name starts with
"get", "is" or "has". In this guide, these types of methods are referred to
as "getters".

.. versionadded:: 2.5
Support for methods starting with ``has`` was introduced in Symfony 2.5.

The benefit of this technique is that it allows you to validate your object
dynamically. For example, suppose you want to make sure that a password field
doesn't match the first name of the user (for security reasons). You can
Expand Down
10 changes: 6 additions & 4 deletions components/class_loader/debug_class_loader.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.. index::
single: ClassLoader; DebugClassLoader

Debugging a Class Loader
========================

Since Symfony 2.4, the ``DebugClassLoader`` of the Class Loader component is
deprecated. Use the
:doc:`DebugClassLoader provided by the Debug component </components/debug/class_loader>`.
.. caution::

The ``DebugClassLoader`` from the ClassLoader component was deprecated
in Symfony 2.5 and will be removed in Symfony 3.0. Use the
:doc:`DebugClassLoader provided by the Debug component </components/debug/class_loader>`.
4 changes: 0 additions & 4 deletions components/class_loader/psr4_class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
The PSR-4 Class Loader
======================

.. versionadded:: 2.5
The :class:`Symfony\\Component\\ClassLoader\\Psr4ClassLoader` was
introduced in Symfony 2.5.

Libraries that follow the `PSR-4`_ standard can be loaded with the ``Psr4ClassLoader``.

.. note::
Expand Down
4 changes: 0 additions & 4 deletions components/console/changing_default_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
Changing the Default Command
============================

.. versionadded:: 2.5
The :method:`Symfony\\Component\\Console\\Application::setDefaultCommand`
method was introduced in Symfony 2.5.

The Console component will always run the ``ListCommand`` when no command name is
passed. In order to change the default command you just need to pass the command
name to the ``setDefaultCommand`` method::
Expand Down
39 changes: 30 additions & 9 deletions components/console/helpers/debug_formatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ Debug Formatter Helper

The :class:`Symfony\\Component\\Console\\Helper\\DebugFormatterHelper` provides
functions to output debug information when running an external program, for
instance a process or HTTP request. It is included in the default helper set
and you can get it by calling
:method:`Symfony\\Component\\Console\\Command\\Command::getHelper`::
instance a process or HTTP request. For example, if you used it to output
the results of running ``ls -la`` on a UNIX system, it might output something
like this:

.. image:: /images/components/console/debug_formatter.png
:align: center

Using the debug_formatter
-------------------------

The formatter is included in the default helper set and you can get it by
calling :method:`Symfony\\Component\\Console\\Command\\Command::getHelper`::

$debugFormatter = $this->getHelper('debug_formatter');

The formatter only formats strings, which you can use to output to the console,
but also to log the information or do anything else.
The formatter accepts strings and returns a formatted string, which you then
output to the console (or even log the information or do anything else).

All methods of this helper have an identifier as the first argument. This is a
unique value for each program. This way, the helper can debug information for
Expand All @@ -39,9 +48,13 @@ display information that the program is started::

// ...
$process = new Process(...);
$process->run();

$output->writeln($debugFormatter->start(spl_object_hash($process), 'Some process description'));
$output->writeln($debugFormatter->start(
spl_object_hash($process),
'Some process description')
);

$process->run();

This will output:

Expand All @@ -51,7 +64,11 @@ This will output:
You can tweak the prefix using the third argument::

$output->writeln($debugFormatter->start(spl_object_hash($process), 'Some process description', 'STARTED');
$output->writeln($debugFormatter->start(
spl_object_hash($process),
'Some process description',
'STARTED'
);
// will output:
// STARTED Some process description

Expand All @@ -69,7 +86,11 @@ using

$process->run(function ($type, $buffer) use ($output, $debugFormatter, $process) {
$output->writeln(
$debugFormatter->progress(spl_object_hash($process), $buffer, Process::ERR === $type)
$debugFormatter->progress(
spl_object_hash($process),
$buffer,
Process::ERR === $type
)
);
});
// ...
Expand Down
6 changes: 3 additions & 3 deletions components/console/helpers/map.rst.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
* :doc:`/components/console/helpers/dialoghelper`
* :doc:`/components/console/helpers/dialoghelper` (deprecated as of 2.5)
* :doc:`/components/console/helpers/formatterhelper`
* :doc:`/components/console/helpers/processhelper`
* :doc:`/components/console/helpers/progressbar`
* :doc:`/components/console/helpers/progresshelper`
* :doc:`/components/console/helpers/progresshelper` (deprecated as of 2.5)
* :doc:`/components/console/helpers/questionhelper`
* :doc:`/components/console/helpers/table`
* :doc:`/components/console/helpers/tablehelper`
* :doc:`/components/console/helpers/tablehelper` (deprecated as of 2.5)
* :doc:`/components/console/helpers/debug_formatter` (new in 2.6)
4 changes: 0 additions & 4 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
Progress Bar
============

.. versionadded:: 2.5
The Progress Bar feature was introduced in Symfony 2.5 as a replacement for
the :doc:`Progress Helper </components/console/helpers/progresshelper>`.

When executing longer-running commands, it may be helpful to show progress
information, which updates as your command runs:

Expand Down
3 changes: 0 additions & 3 deletions components/console/helpers/progresshelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Progress Helper
.. versionadded:: 2.3
The ``setCurrent`` method was introduced in Symfony 2.3.

.. versionadded:: 2.4
The ``clear`` method was introduced in Symfony 2.4.

.. caution::

The Progress Helper was deprecated in Symfony 2.5 and will be removed in
Expand Down
3 changes: 0 additions & 3 deletions components/console/helpers/questionhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Question Helper
===============

.. versionadded:: 2.5
The Question Helper was introduced in Symfony 2.5.

The :class:`Symfony\\Component\\Console\\Helper\\QuestionHelper` provides
functions to ask the user for more information. It is included in the default
helper set, which you can get by calling
Expand Down
4 changes: 0 additions & 4 deletions components/console/helpers/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
Table
=====

.. versionadded:: 2.5
The ``Table`` class was introduced in Symfony 2.5 as a replacement for the
:doc:`Table Helper </components/console/helpers/tablehelper>`.

When building a console application it may be useful to display tabular data:

.. code-block:: text
Expand Down
Loading

0 comments on commit 907ee0d

Please sign in to comment.