Skip to content

Commit 4dd1f25

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: (55 commits) Removed an unneeded reference to Symfony 2.4 version Added a mention to the @Security annotation More xml fixes Xml changes and line-break changes Swiched mydomain and specialdomain Changes recommended by @cordoval Changes recommended by @javierguiluz Changed line-breaks in text Added improvments from @wouterj fixed typo in "except" Document whitelist option to email redirect Typo Improve assetic:watch text Update asset_management.rst Link to standard edition so users can get the app/AppKernel.php if needed. [#4423] Added missing word Update tests.rst ensure consistency with the note Update security.rst Minor grammar fix ...
2 parents 16dcf53 + 9caab86 commit 4dd1f25

32 files changed

+262
-143
lines changed

best_practices/tests.rst

+26-16
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,35 @@ A functional test can be as easy as this:
3030

3131
.. code-block:: php
3232
33-
/** @dataProvider provideUrls */
34-
public function testPageIsSuccessful($url)
35-
{
36-
$client = self::createClient();
37-
$client->request('GET', $url);
33+
// src/AppBundle/Tests/ApplicationAvailabilityFunctionalTest.php
34+
namespace AppBundle\Tests;
3835
39-
$this->assertTrue($client->getResponse()->isSuccessful());
40-
}
36+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
4137
42-
public function provideUrls()
38+
class ApplicationAvailabilityFunctionalTest extends WebTestCase
4339
{
44-
return array(
45-
array('/'),
46-
array('/posts'),
47-
array('/post/fixture-post-1'),
48-
array('/blog/category/fixture-category'),
49-
array('/archives'),
50-
// ...
51-
);
40+
/**
41+
* @dataProvider urlProvider
42+
*/
43+
public function testPageIsSuccessful($url)
44+
{
45+
$client = self::createClient();
46+
$client->request('GET', $url);
47+
48+
$this->assertTrue($client->getResponse()->isSuccessful());
49+
}
50+
51+
public function urlProvider()
52+
{
53+
return array(
54+
array('/'),
55+
array('/posts'),
56+
array('/post/fixture-post-1'),
57+
array('/blog/category/fixture-category'),
58+
array('/archives'),
59+
// ...
60+
);
61+
}
5262
}
5363
5464
This code checks that all the given URLs load successfully, which means that

book/controller.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Controllers are also called *actions*.
116116

117117
This controller is pretty straightforward:
118118

119-
* *line 4*: Symfony takes advantage of PHP 5.3 namespace functionality to
119+
* *line 4*: Symfony takes advantage of PHP's namespace functionality to
120120
namespace the entire controller class. The ``use`` keyword imports the
121121
``Response`` class, which the controller must return.
122122

book/from_flat_php_to_symfony2.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ content:
435435
436436
{
437437
"require": {
438-
"symfony/symfony": "2.5.*"
438+
"symfony/symfony": "2.6.*"
439439
},
440440
"autoload": {
441441
"files": ["model.php","controllers.php"]
@@ -646,7 +646,7 @@ A routing configuration map provides this information in a readable format:
646646
647647
Now that Symfony is handling all the mundane tasks, the front controller
648648
is dead simple. And since it does so little, you'll never have to touch
649-
it once it's created (and if you use a Symfony distribution, you won't
649+
it once it's created (and if you use a `Symfony distribution`_, you won't
650650
even need to create it!)::
651651

652652
// web/app.php
@@ -761,3 +761,4 @@ Learn more from the Cookbook
761761
.. _`Twig`: http://twig.sensiolabs.org
762762
.. _`Varnish`: https://www.varnish-cache.org/
763763
.. _`PHPUnit`: http://www.phpunit.de
764+
.. _`Symfony distribution`: https://github.com/symfony/symfony-standard

book/security.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ is both flexible and (hopefully) fun to work with.
1414
Since there's a lot to talk about, this chapter is organized into a few big
1515
sections:
1616

17-
1) Initial ``security.yml`` setup (*authentication*);
17+
#. Initial ``security.yml`` setup (*authentication*);
1818

19-
2) Denying access to your app (*authorization*);
19+
#. Denying access to your app (*authorization*);
2020

21-
3) Fetching the current User object
21+
#. Fetching the current User object.
2222

2323
These are followed by a number of small (but still captivating) sections,
2424
like :ref:`logging out <book-security-logging-out>` and :ref:`encoding user passwords <security-encoding-password>`.
@@ -492,7 +492,7 @@ else, you'll want to encode their passwords. The best algorithm to use is
492492
493493
'encoders' => array(
494494
'Symfony\Component\Security\Core\User\User' => array(
495-
'algorithm' => 'plaintext',
495+
'algorithm' => 'bcrypt',
496496
'cost' => 12,
497497
)
498498
),

book/testing.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ and pass it a ``Link`` object::
622622
Forms
623623
~~~~~
624624

625-
Just like links, you select forms with the ``selectButton()`` method::
625+
Forms can be selected using their buttons, which can be selected with the
626+
``selectButton()`` method, just like links::
626627

627628
$buttonCrawlerNode = $crawler->selectButton('submit');
628629

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ By calling ``validate`` on the validator, you can pass in a raw value and
12491249
the constraint object that you want to validate that value against. A full
12501250
list of the available constraints - as well as the full class name for each
12511251
constraint - is available in the :doc:`constraints reference </reference/constraints>`
1252-
section .
1252+
section.
12531253

12541254
The ``validate`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
12551255
object, which acts just like an array of errors. Each error in the collection

components/class_loader/map_class_loader.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Usage
2525
Using it is as easy as passing your mapping to its constructor when creating
2626
an instance of the ``MapClassLoader`` class::
2727

28-
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader';
28+
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader.php';
2929

3030
$mapping = array(
3131
'Foo' => '/path/to/Foo',

components/console/events.rst

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ the wheel, it uses the Symfony EventDispatcher component to do the work::
2020
$application->setDispatcher($dispatcher);
2121
$application->run();
2222

23+
.. caution::
24+
25+
Console events are only triggered by the main command being executed.
26+
Commands called by the main command will not trigger any event.
27+
2328
The ``ConsoleEvents::COMMAND`` Event
2429
------------------------------------
2530

components/console/helpers/questionhelper.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ In this case, the user will be asked "Continue with this action?". If the user
3838
answers with ``y`` it returns ``true`` or ``false`` if they answer with ``n``.
3939
The second argument to
4040
:method:`Symfony\\Component\\Console\\Question\\ConfirmationQuestion::__construct`
41-
is the default value to return if the user doesn't enter any input. Any other
42-
input will ask the same question again.
41+
is the default value to return if the user doesn't enter any valid input. If
42+
the second argument is not provided, ``true`` is assumed.
4343

4444
.. tip::
4545

components/expression_language/caching.rst

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
6464
// ...
6565
6666
$expression = new SerializedParsedExpression(
67+
'1 + 4',
6768
serialize($language->parse('1 + 4', array()))
6869
);
6970

components/filesystem/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Filesystem Component
88

99
.. tip::
1010

11-
A lock handler feature was introduce in symfony 2.6.
11+
The lock handler feature was introduced in symfony 2.6.
1212
:doc:`See the documentation for more information </components/filesystem/lock_handler>`.
1313

1414
Installation

components/http_foundation/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ Serving Files
473473
When sending a file, you must add a ``Content-Disposition`` header to your
474474
response. While creating this header for basic file downloads is easy, using
475475
non-ASCII filenames is more involving. The
476-
:method:`Symfony\\Component\\HttpFoundation\\Response::makeDisposition`
476+
:method:`Symfony\\Component\\HttpFoundation\\ResponseHeaderBag::makeDisposition`
477477
abstracts the hard work behind a simple API::
478478

479479
use Symfony\Component\HttpFoundation\ResponseHeaderBag;

components/translation/usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ recommended format. These files are parsed by one of the loader classes.
217217
'symfony.is.great' => 'Symfony is great',
218218
'symfony.is.amazing' => 'Symfony is amazing',
219219
'symfony.has.bundles' => 'Symfony has bundles',
220-
'user.login' => 'Login',
220+
'user.login' => 'Login',
221221
);
222222
223223
.. _component-translation-pluralization:

components/yaml/yaml_format.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ The following YAML is equivalent to the following PHP code:
228228
.. code-block:: php
229229
230230
array(
231-
'symfony 1.0' => array(
232-
'PHP' => 5.0,
233-
'Propel' => 1.2,
234-
),
235-
'symfony 1.2' => array(
236-
'PHP' => 5.2,
237-
'Propel' => 1.3,
238-
),
231+
'symfony 1.0' => array(
232+
'PHP' => 5.0,
233+
'Propel' => 1.2,
234+
),
235+
'symfony 1.2' => array(
236+
'PHP' => 5.2,
237+
'Propel' => 1.3,
238+
),
239239
);
240240
241241
There is one important thing you need to remember when using indentation in a

cookbook/assetic/asset_management.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,16 @@ need to dump them manually. To do so, run the following:
540540
541541
This physically writes all of the asset files you need for your ``dev``
542542
environment. The big disadvantage is that you need to run this each time
543-
you update an asset. Fortunately, by passing the ``--watch`` option, the
544-
command will automatically regenerate assets *as they change*:
543+
you update an asset. Fortunately, by using the ``assetic:watch`` command,
544+
assets will be regenerated automatically *as they change*:
545545

546546
.. code-block:: bash
547547
548-
$ php app/console assetic:dump --watch
548+
$ php app/console assetic:watch
549+
550+
The ``assetic:watch`` command was introduced in AsseticBundle 2.4. In prior
551+
versions, you had to use the ``--watch`` option of the ``assetic:dump``
552+
command for the same behavior.
549553

550554
Since running this command in the ``dev`` environment may generate a bunch
551555
of files, it's usually a good idea to point your generated asset files to

cookbook/bundles/best_practices.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ Bundle Name
2929
-----------
3030

3131
A bundle is also a PHP namespace. The namespace must follow the technical
32-
interoperability `standards`_ for PHP 5.3 namespaces and class names: it
33-
starts with a vendor segment, followed by zero or more category segments, and
34-
it ends with the namespace short name, which must end with a ``Bundle``
35-
suffix.
32+
interoperability `standards`_ for PHP namespaces and class names: it starts
33+
with a vendor segment, followed by zero or more category segments, and it ends
34+
with the namespace short name, which must end with a ``Bundle`` suffix.
3635

3736
A namespace becomes a bundle as soon as you add a bundle class to it. The
3837
bundle class name must follow these simple rules:

cookbook/cache/varnish.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ If you know for sure that the backend never uses sessions or basic
7272
authentication, have varnish remove the corresponding header from requests to
7373
prevent clients from bypassing the cache. In practice, you will need sessions
7474
at least for some parts of the site, e.g. when using forms with
75-
:ref:`CSRF Protection <forms-csrf>`. In this situation, make sure to only
76-
start a session when actually needed, and clear the session when it is no
77-
longer needed. Alternatively, you can look into :doc:`../cache/form_csrf_caching`.
78-
79-
.. todo link "only start a session when actually needed" to cookbook/session/avoid_session_start once https://github.com/symfony/symfony-docs/pull/4661 is merged
75+
:ref:`CSRF Protection <forms-csrf>`. In this situation, make sure to
76+
:doc:`only start a session when actually needed </cookbook/session/avoid_session_start>`
77+
and clear the session when it is no longer needed. Alternatively, you can look
78+
into :doc:`/cookbook/cache/form_csrf_caching`.
8079

8180
Cookies created in Javascript and used only in the frontend, e.g. when using
8281
Google analytics are nonetheless sent to the server. These cookies are not

0 commit comments

Comments
 (0)