Skip to content

Commit 5ba2227

Browse files
committed
Merge branch '2.3' into 2.4
2 parents bede4c3 + 67b7bbd commit 5ba2227

32 files changed

+154
-72
lines changed

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ Now, change the ``User`` class to implement
10721072
add the
10731073
:method:`Symfony\\Component\\Validator\\GroupSequenceProviderInterface::getGroupSequence`,
10741074
which should return an array of groups to use. Also, add the
1075-
``@Assert\GroupSequenceProvider`` annotation to the class. If you imagine
1075+
``@Assert\GroupSequenceProvider`` annotation to the class (or ``group_sequence_provider: true`` to the YAML). If you imagine
10761076
that a method called ``isPremium`` returns true if the user is a premium member,
10771077
then your code might look like this::
10781078

components/console/introduction.rst

+15-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Creating a basic Command
3535
To make a console command that greets you from the command line, create ``GreetCommand.php``
3636
and add the following to it::
3737

38-
namespace Acme\DemoBundle\Command;
38+
namespace Acme\Command;
3939

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

8787
#!/usr/bin/env php
8888
<?php
89-
// app/console
89+
// application.php
9090

91-
use Acme\DemoBundle\Command\GreetCommand;
91+
use Acme\Command\GreetCommand;
9292
use Symfony\Component\Console\Application;
9393

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

100100
.. code-block:: bash
101101
102-
$ app/console demo:greet Fabien
102+
$ php application.php demo:greet Fabien
103103
104104
This will print the following to the command line:
105105

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

112112
.. code-block:: bash
113113
114-
$ app/console demo:greet Fabien --yell
114+
$ php application.php demo:greet Fabien --yell
115115
116116
This prints::
117117

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

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

287287
.. code-block:: bash
288288
289-
$ app/console demo:greet Fabien Ryan Bernhard
289+
$ php application.php demo:greet Fabien Ryan Bernhard
290290
291291
You can access the ``names`` argument as an array::
292292

@@ -356,8 +356,8 @@ flag:
356356

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

369369
.. code-block:: bash
370370
371-
$ app/console demo:greet Fabien --iterations=5 --yell
372-
$ app/console demo:greet Fabien --yell --iterations=5
371+
$ php application.php demo:greet Fabien --iterations=5 --yell
372+
$ php application.php demo:greet Fabien --yell --iterations=5
373373
374374
There are 4 option variants you can use:
375375

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

418+
use Acme\Command\GreetCommand;
418419
use Symfony\Component\Console\Application;
419420
use Symfony\Component\Console\Tester\CommandTester;
420-
use Acme\DemoBundle\Command\GreetCommand;
421421

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

447+
use Acme\Command\GreetCommand;
447448
use Symfony\Component\Console\Application;
448449
use Symfony\Component\Console\Tester\CommandTester;
449-
use Acme\DemoBundle\Command\GreetCommand;
450450

451451
class ListCommandTest extends \PHPUnit_Framework_TestCase
452452
{
@@ -526,6 +526,7 @@ Learn More!
526526

527527
* :doc:`/components/console/usage`
528528
* :doc:`/components/console/single_command_tool`
529+
* :doc:`/components/console/events`
529530

530531
.. _Packagist: https://packagist.org/packages/symfony/console
531532
.. _ANSICON: https://github.com/adoxa/ansicon/downloads

components/console/single_command_tool.rst

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can also simplify how you execute the application::
6666
#!/usr/bin/env php
6767
<?php
6868
// command.php
69+
6970
use Acme\Tool\MyApplication;
7071

7172
$application = new MyApplication();

components/console/usage.rst

+24-24
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ built-in options as well as a couple of built-in commands for the Console compon
99

1010
.. note::
1111

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

1515
#!/usr/bin/env php
16-
# app/console
1716
<?php
17+
// application.php
1818

1919
use Symfony\Component\Console\Application;
2020

@@ -30,26 +30,26 @@ and the registered commands:
3030

3131
.. code-block:: bash
3232
33-
$ php app/console list
33+
$ php application.php list
3434
3535
You can get the same output by not running any command as well
3636

3737
.. code-block:: bash
3838
39-
$ php app/console
39+
$ php application.php
4040
4141
The help command lists the help information for the specified command. For
4242
example, to get the help for the ``list`` command:
4343

4444
.. code-block:: bash
4545
46-
$ php app/console help list
46+
$ php application.php help list
4747
4848
Running ``help`` without specifying a command will list the global options:
4949

5050
.. code-block:: bash
5151
52-
$ php app/console help
52+
$ php application.php help
5353
5454
Global Options
5555
~~~~~~~~~~~~~~
@@ -59,33 +59,33 @@ get help for the list command:
5959

6060
.. code-block:: bash
6161
62-
$ php app/console list --help
63-
$ php app/console list -h
62+
$ php application.php list --help
63+
$ php application.php list -h
6464
6565
You can suppress output with:
6666

6767
.. code-block:: bash
6868
69-
$ php app/console list --quiet
70-
$ php app/console list -q
69+
$ php application.php list --quiet
70+
$ php application.php list -q
7171
7272
You can get more verbose messages (if this is supported for a command)
7373
with:
7474

7575
.. code-block:: bash
7676
77-
$ php app/console list --verbose
78-
$ php app/console list -v
77+
$ php application.php list --verbose
78+
$ php application.php list -v
7979
8080
The verbose flag can optionally take a value between 1 (default) and 3 to
8181
output even more verbose messages:
8282

8383
.. code-block:: bash
8484
85-
$ php app/console list --verbose=2
86-
$ php app/console list -vv
87-
$ php app/console list --verbose=3
88-
$ php app/console list -vvv
85+
$ php application.php list --verbose=2
86+
$ php application.php list -vv
87+
$ php application.php list --verbose=3
88+
$ php application.php list -vvv
8989
9090
If you set the optional arguments to give your application a name and version::
9191

@@ -95,8 +95,8 @@ then you can use:
9595

9696
.. code-block:: bash
9797
98-
$ php app/console list --version
99-
$ php app/console list -V
98+
$ php application.php list --version
99+
$ php application.php list -V
100100
101101
to get this information output:
102102

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

115115
.. code-block:: bash
116116
117-
$ php app/console list --ansi
117+
$ php application.php list --ansi
118118
119119
or turn it off with:
120120

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

127127
.. code-block:: bash
128128
129-
$ php app/console list --no-interaction
130-
$ php app/console list -n
129+
$ php application.php list --no-interaction
130+
$ php application.php list -n
131131
132132
Shortcut Syntax
133133
~~~~~~~~~~~~~~~
@@ -138,7 +138,7 @@ commands, then you can run ``help`` like this:
138138

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

148148
.. code-block:: bash
149149
150-
$ php app/console d:g Fabien
150+
$ php application.php d:g Fabien
151151
152152
If you enter a short command that's ambiguous (i.e. there are more than one
153153
command that match), then no command will be run and some suggestions of

components/http_foundation/session_configuration.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on.
2828
All native save handlers are internal to PHP and as such, have no public facing API.
2929
They must be configured by ``php.ini`` directives, usually ``session.save_path`` and
3030
potentially other driver specific directives. Specific details can be found in
31-
docblock of the ``setOptions()`` method of each class.
31+
the docblock of the ``setOptions()`` method of each class. For instance, the one
32+
provided by the Memcached extension can be found on `php.net/memcached.setoption`_
3233

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

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

@@ -61,7 +62,7 @@ Example usage::
6162
Custom Save Handlers
6263
--------------------
6364

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

@@ -234,6 +235,11 @@ PHP 5.4 functionality if it is available.
234235
Save Handler Proxy
235236
~~~~~~~~~~~~~~~~~~
236237

238+
A Save Handler Proxy is basically a wrapper around a Save Handler that was
239+
introduced to support seamlessly the migration from PHP 5.3 to PHP 5.4+. It
240+
further creates an extension point from where custom logic can be added that
241+
works independently of which handler is being wrapped inside.
242+
237243
There are two kinds of save handler class proxies which inherit from
238244
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractProxy`:
239245
they are :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeProxy`
@@ -263,3 +269,4 @@ without knowledge of the specific save handler.
263269

264270
.. _`php.net/session.customhandler`: http://php.net/session.customhandler
265271
.. _`php.net/session.configuration`: http://php.net/session.configuration
272+
.. _`php.net/memcached.setoption`: http://php.net/memcached.setoption

cookbook/bundles/remove.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ starting a project, but you'll probably want to eventually remove it.
1818

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

2424
// app/AppKernel.php
2525

@@ -96,8 +96,8 @@ rely on the bundle you are about to remove.
9696
.. tip::
9797

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

102102
.. tip::
103103

cookbook/form/form_collections.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ that Task, right inside the same form.
2020
including the ``ManyToMany`` association mapping definition on the Task's
2121
``tags`` property.
2222

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

2626
// src/Acme/TaskBundle/Entity/Task.php

cookbook/security/custom_authentication_provider.rst

+7
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ a 403 Response is returned.
194194
does not require maintaining authentication sessions or login forms, it
195195
won't be used for this example.
196196

197+
.. note::
198+
199+
Returning prematurely from the listener is relevant only if you want to chain
200+
authentication providers (for example to allow anonymous users). If you want
201+
to forbid access to anonymous users and have a nice 403 error, you should set
202+
the status code of the response before returning.
203+
197204
The Authentication Provider
198205
---------------------------
199206

reference/forms/types/button.rst

+3
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ Options
3838

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

41+
Overridden Options
42+
------------------
43+
4144
.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc

reference/forms/types/checkbox.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ if the box is unchecked, the value will be set to false.
1414
| Options | - `value`_ |
1515
+-------------+------------------------------------------------------------------------+
1616
| Inherited | - `data`_ |
17-
| options | - `required`_ |
17+
| options | - `empty_data`_ |
18+
| | - `required`_ |
1819
| | - `label`_ |
1920
| | - `label_attr`_ |
2021
| | - `read_only`_ |
@@ -60,6 +61,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
6061

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

64+
.. include:: /reference/forms/types/options/empty_data.rst.inc
65+
6366
.. include:: /reference/forms/types/options/required.rst.inc
6467

6568
.. include:: /reference/forms/types/options/label.rst.inc

reference/forms/types/collection.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ forms, which is useful when creating forms that expose one-to-many relationships
2121
| | - `prototype_name`_ |
2222
+-------------+-----------------------------------------------------------------------------+
2323
| Inherited | - `label`_ |
24-
| | - `label_attr`_ |
25-
| options | - `error_bubbling`_ |
24+
| options | - `label_attr`_ |
25+
| | - `error_bubbling`_ |
2626
| | - `error_mapping`_ |
2727
| | - `by_reference`_ |
2828
| | - `empty_data`_ |

0 commit comments

Comments
 (0)