Skip to content

Commit

Permalink
Merge branch '2.3' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Jan 20, 2014
2 parents bede4c3 + 67b7bbd commit 5ba2227
Show file tree
Hide file tree
Showing 32 changed files with 154 additions and 72 deletions.
2 changes: 1 addition & 1 deletion book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ Now, change the ``User`` class to implement
add the
:method:`Symfony\\Component\\Validator\\GroupSequenceProviderInterface::getGroupSequence`,
which should return an array of groups to use. Also, add the
``@Assert\GroupSequenceProvider`` annotation to the class. If you imagine
``@Assert\GroupSequenceProvider`` annotation to the class (or ``group_sequence_provider: true`` to the YAML). If you imagine
that a method called ``isPremium`` returns true if the user is a premium member,
then your code might look like this::

Expand Down
29 changes: 15 additions & 14 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Creating a basic Command
To make a console command that greets you from the command line, create ``GreetCommand.php``
and add the following to it::

namespace Acme\DemoBundle\Command;
namespace Acme\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
Expand Down Expand Up @@ -86,9 +86,9 @@ an ``Application`` and adds commands to it::

#!/usr/bin/env php
<?php
// app/console
// application.php

use Acme\DemoBundle\Command\GreetCommand;
use Acme\Command\GreetCommand;
use Symfony\Component\Console\Application;

$application = new Application();
Expand All @@ -99,7 +99,7 @@ Test the new console command by running the following

.. code-block:: bash
$ app/console demo:greet Fabien
$ php application.php demo:greet Fabien
This will print the following to the command line:

Expand All @@ -111,7 +111,7 @@ You can also use the ``--yell`` option to make everything uppercase:

.. code-block:: bash
$ app/console demo:greet Fabien --yell
$ php application.php demo:greet Fabien --yell
This prints::

Expand Down Expand Up @@ -267,8 +267,8 @@ The command can now be used in either of the following ways:

.. code-block:: bash
$ app/console demo:greet Fabien
$ app/console demo:greet Fabien Potencier
$ php application.php demo:greet Fabien
$ php application.php demo:greet Fabien Potencier
It is also possible to let an argument take a list of values (imagine you want
to greet all your friends). For this it must be specified at the end of the
Expand All @@ -286,7 +286,7 @@ To use this, just specify as many names as you want:

.. code-block:: bash
$ app/console demo:greet Fabien Ryan Bernhard
$ php application.php demo:greet Fabien Ryan Bernhard
You can access the ``names`` argument as an array::

Expand Down Expand Up @@ -356,8 +356,8 @@ flag:

.. code-block:: bash
$ app/console demo:greet Fabien
$ app/console demo:greet Fabien --iterations=5
$ php application.php demo:greet Fabien
$ php application.php demo:greet Fabien --iterations=5
The first example will only print once, since ``iterations`` is empty and
defaults to ``1`` (the last argument of ``addOption``). The second example
Expand All @@ -368,8 +368,8 @@ will work:

.. code-block:: bash
$ app/console demo:greet Fabien --iterations=5 --yell
$ app/console demo:greet Fabien --yell --iterations=5
$ php application.php demo:greet Fabien --iterations=5 --yell
$ php application.php demo:greet Fabien --yell --iterations=5
There are 4 option variants you can use:

Expand Down Expand Up @@ -415,9 +415,9 @@ useful one is the :class:`Symfony\\Component\\Console\\Tester\\CommandTester`
class. It uses special input and output classes to ease testing without a real
console::

use Acme\Command\GreetCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use Acme\DemoBundle\Command\GreetCommand;

class ListCommandTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -444,9 +444,9 @@ You can test sending arguments and options to the command by passing them
as an array to the :method:`Symfony\\Component\\Console\\Tester\\CommandTester::execute`
method::

use Acme\Command\GreetCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use Acme\DemoBundle\Command\GreetCommand;

class ListCommandTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -526,6 +526,7 @@ Learn More!

* :doc:`/components/console/usage`
* :doc:`/components/console/single_command_tool`
* :doc:`/components/console/events`

.. _Packagist: https://packagist.org/packages/symfony/console
.. _ANSICON: https://github.com/adoxa/ansicon/downloads
1 change: 1 addition & 0 deletions components/console/single_command_tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ You can also simplify how you execute the application::
#!/usr/bin/env php
<?php
// command.php

use Acme\Tool\MyApplication;

$application = new MyApplication();
Expand Down
48 changes: 24 additions & 24 deletions components/console/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ built-in options as well as a couple of built-in commands for the Console compon

.. note::

These examples assume you have added a file ``app/console`` to run at
These examples assume you have added a file ``application.php`` to run at
the cli::

#!/usr/bin/env php
# app/console
<?php
// application.php

use Symfony\Component\Console\Application;

Expand All @@ -30,26 +30,26 @@ and the registered commands:

.. code-block:: bash
$ php app/console list
$ php application.php list
You can get the same output by not running any command as well

.. code-block:: bash
$ php app/console
$ php application.php
The help command lists the help information for the specified command. For
example, to get the help for the ``list`` command:

.. code-block:: bash
$ php app/console help list
$ php application.php help list
Running ``help`` without specifying a command will list the global options:

.. code-block:: bash
$ php app/console help
$ php application.php help
Global Options
~~~~~~~~~~~~~~
Expand All @@ -59,33 +59,33 @@ get help for the list command:

.. code-block:: bash
$ php app/console list --help
$ php app/console list -h
$ php application.php list --help
$ php application.php list -h
You can suppress output with:

.. code-block:: bash
$ php app/console list --quiet
$ php app/console list -q
$ php application.php list --quiet
$ php application.php list -q
You can get more verbose messages (if this is supported for a command)
with:

.. code-block:: bash
$ php app/console list --verbose
$ php app/console list -v
$ php application.php list --verbose
$ php application.php list -v
The verbose flag can optionally take a value between 1 (default) and 3 to
output even more verbose messages:

.. code-block:: bash
$ php app/console list --verbose=2
$ php app/console list -vv
$ php app/console list --verbose=3
$ php app/console list -vvv
$ php application.php list --verbose=2
$ php application.php list -vv
$ php application.php list --verbose=3
$ php application.php list -vvv
If you set the optional arguments to give your application a name and version::

Expand All @@ -95,8 +95,8 @@ then you can use:

.. code-block:: bash
$ php app/console list --version
$ php app/console list -V
$ php application.php list --version
$ php application.php list -V
to get this information output:

Expand All @@ -114,20 +114,20 @@ You can force turning on ANSI output coloring with:

.. code-block:: bash
$ php app/console list --ansi
$ php application.php list --ansi
or turn it off with:

.. code-block:: bash
$ php app/console list --no-ansi
$ php application.php list --no-ansi
You can suppress any interactive questions from the command you are running with:

.. code-block:: bash
$ php app/console list --no-interaction
$ php app/console list -n
$ php application.php list --no-interaction
$ php application.php list -n
Shortcut Syntax
~~~~~~~~~~~~~~~
Expand All @@ -138,7 +138,7 @@ commands, then you can run ``help`` like this:

.. code-block:: bash
$ php app/console h
$ php application.php h
If you have commands using ``:`` to namespace commands then you just have
to type the shortest unambiguous text for each part. If you have created the
Expand All @@ -147,7 +147,7 @@ can run it with:

.. code-block:: bash
$ php app/console d:g Fabien
$ php application.php d:g Fabien
If you enter a short command that's ambiguous (i.e. there are more than one
command that match), then no command will be run and some suggestions of
Expand Down
13 changes: 10 additions & 3 deletions components/http_foundation/session_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on.
All native save handlers are internal to PHP and as such, have no public facing API.
They must be configured by ``php.ini`` directives, usually ``session.save_path`` and
potentially other driver specific directives. Specific details can be found in
docblock of the ``setOptions()`` method of each class.
the docblock of the ``setOptions()`` method of each class. For instance, the one
provided by the Memcached extension can be found on `php.net/memcached.setoption`_

While native save handlers can be activated by directly using
``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to
activate these in the same way as custom handlers.
activate these in the same way as it does for custom handlers.

Symfony2 provides drivers for the following native save handler as an example:

Expand Down Expand Up @@ -61,7 +62,7 @@ Example usage::
Custom Save Handlers
--------------------

Custom handlers are those which completely replace PHP's built in session save
Custom handlers are those which completely replace PHP's built-in session save
handlers by providing six callback functions which PHP calls internally at
various points in the session workflow.

Expand Down Expand Up @@ -234,6 +235,11 @@ PHP 5.4 functionality if it is available.
Save Handler Proxy
~~~~~~~~~~~~~~~~~~

A Save Handler Proxy is basically a wrapper around a Save Handler that was
introduced to support seamlessly the migration from PHP 5.3 to PHP 5.4+. It
further creates an extension point from where custom logic can be added that
works independently of which handler is being wrapped inside.

There are two kinds of save handler class proxies which inherit from
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractProxy`:
they are :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeProxy`
Expand Down Expand Up @@ -263,3 +269,4 @@ without knowledge of the specific save handler.

.. _`php.net/session.customhandler`: http://php.net/session.customhandler
.. _`php.net/session.configuration`: http://php.net/session.configuration
.. _`php.net/memcached.setoption`: http://php.net/memcached.setoption
8 changes: 4 additions & 4 deletions cookbook/bundles/remove.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ starting a project, but you'll probably want to eventually remove it.

To disconnect the bundle from the framework, you should remove the bundle from
the ``AppKernel::registerBundles()`` method. The bundle is normally found in
the ``$bundles`` array but the AcmeDemoBundle is only registered in a
development environment and you can find him in the if statement after::
the ``$bundles`` array but the AcmeDemoBundle is only registered in the
development environment and you can find it inside the if statement below::

// app/AppKernel.php

Expand Down Expand Up @@ -96,8 +96,8 @@ rely on the bundle you are about to remove.
.. tip::

If one bundle relies on another, in most it means that it uses some services
from the bundle. Searching for a ``acme_demo`` string may help you spot
them.
from the bundle. Searching for the bundle alias string may help you spot
them (e.g. ``acme_demo`` for bundles depending on AcmeDemoBundle).

.. tip::

Expand Down
2 changes: 1 addition & 1 deletion cookbook/form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ that Task, right inside the same form.
including the ``ManyToMany`` association mapping definition on the Task's
``tags`` property.

Let's start there: suppose that each ``Task`` belongs to multiple ``Tags``
Let's start there: suppose that each ``Task`` belongs to multiple ``Tag``
objects. Start by creating a simple ``Task`` class::

// src/Acme/TaskBundle/Entity/Task.php
Expand Down
7 changes: 7 additions & 0 deletions cookbook/security/custom_authentication_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ a 403 Response is returned.
does not require maintaining authentication sessions or login forms, it
won't be used for this example.

.. note::

Returning prematurely from the listener is relevant only if you want to chain
authentication providers (for example to allow anonymous users). If you want
to forbid access to anonymous users and have a nice 403 error, you should set
the status code of the response before returning.

The Authentication Provider
---------------------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ Options

.. include:: /reference/forms/types/options/button_translation_domain.rst.inc

Overridden Options
------------------

.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc
5 changes: 4 additions & 1 deletion reference/forms/types/checkbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ if the box is unchecked, the value will be set to false.
| Options | - `value`_ |
+-------------+------------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `required`_ |
| options | - `empty_data`_ |
| | - `required`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `read_only`_ |
Expand Down Expand Up @@ -60,6 +61,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:

.. include:: /reference/forms/types/options/data.rst.inc

.. include:: /reference/forms/types/options/empty_data.rst.inc

.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/label.rst.inc
Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ forms, which is useful when creating forms that expose one-to-many relationships
| | - `prototype_name`_ |
+-------------+-----------------------------------------------------------------------------+
| Inherited | - `label`_ |
| | - `label_attr`_ |
| options | - `error_bubbling`_ |
| options | - `label_attr`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `by_reference`_ |
| | - `empty_data`_ |
Expand Down
Loading

0 comments on commit 5ba2227

Please sign in to comment.