Skip to content

Commit

Permalink
Merge branch '2.6' into 2.7
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
weaverryan committed Feb 24, 2015
2 parents 16dcf53 + 9caab86 commit 4dd1f25
Show file tree
Hide file tree
Showing 32 changed files with 262 additions and 143 deletions.
42 changes: 26 additions & 16 deletions best_practices/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,35 @@ A functional test can be as easy as this:

.. code-block:: php
/** @dataProvider provideUrls */
public function testPageIsSuccessful($url)
{
$client = self::createClient();
$client->request('GET', $url);
// src/AppBundle/Tests/ApplicationAvailabilityFunctionalTest.php
namespace AppBundle\Tests;
$this->assertTrue($client->getResponse()->isSuccessful());
}
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
public function provideUrls()
class ApplicationAvailabilityFunctionalTest extends WebTestCase
{
return array(
array('/'),
array('/posts'),
array('/post/fixture-post-1'),
array('/blog/category/fixture-category'),
array('/archives'),
// ...
);
/**
* @dataProvider urlProvider
*/
public function testPageIsSuccessful($url)
{
$client = self::createClient();
$client->request('GET', $url);
$this->assertTrue($client->getResponse()->isSuccessful());
}
public function urlProvider()
{
return array(
array('/'),
array('/posts'),
array('/post/fixture-post-1'),
array('/blog/category/fixture-category'),
array('/archives'),
// ...
);
}
}
This code checks that all the given URLs load successfully, which means that
Expand Down
2 changes: 1 addition & 1 deletion book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Controllers are also called *actions*.

This controller is pretty straightforward:

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

Expand Down
5 changes: 3 additions & 2 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ content:
{
"require": {
"symfony/symfony": "2.5.*"
"symfony/symfony": "2.6.*"
},
"autoload": {
"files": ["model.php","controllers.php"]
Expand Down Expand Up @@ -646,7 +646,7 @@ A routing configuration map provides this information in a readable format:
Now that Symfony is handling all the mundane tasks, the front controller
is dead simple. And since it does so little, you'll never have to touch
it once it's created (and if you use a Symfony distribution, you won't
it once it's created (and if you use a `Symfony distribution`_, you won't
even need to create it!)::

// web/app.php
Expand Down Expand Up @@ -761,3 +761,4 @@ Learn more from the Cookbook
.. _`Twig`: http://twig.sensiolabs.org
.. _`Varnish`: https://www.varnish-cache.org/
.. _`PHPUnit`: http://www.phpunit.de
.. _`Symfony distribution`: https://github.com/symfony/symfony-standard
8 changes: 4 additions & 4 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ is both flexible and (hopefully) fun to work with.
Since there's a lot to talk about, this chapter is organized into a few big
sections:

1) Initial ``security.yml`` setup (*authentication*);
#. Initial ``security.yml`` setup (*authentication*);

2) Denying access to your app (*authorization*);
#. Denying access to your app (*authorization*);

3) Fetching the current User object
#. Fetching the current User object.

These are followed by a number of small (but still captivating) sections,
like :ref:`logging out <book-security-logging-out>` and :ref:`encoding user passwords <security-encoding-password>`.
Expand Down Expand Up @@ -492,7 +492,7 @@ else, you'll want to encode their passwords. The best algorithm to use is
'encoders' => array(
'Symfony\Component\Security\Core\User\User' => array(
'algorithm' => 'plaintext',
'algorithm' => 'bcrypt',
'cost' => 12,
)
),
Expand Down
3 changes: 2 additions & 1 deletion book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ and pass it a ``Link`` object::
Forms
~~~~~

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

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

Expand Down
2 changes: 1 addition & 1 deletion book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ By calling ``validate`` on the validator, you can pass in a raw value and
the constraint object that you want to validate that value against. A full
list of the available constraints - as well as the full class name for each
constraint - is available in the :doc:`constraints reference </reference/constraints>`
section .
section.

The ``validate`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
object, which acts just like an array of errors. Each error in the collection
Expand Down
2 changes: 1 addition & 1 deletion components/class_loader/map_class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Usage
Using it is as easy as passing your mapping to its constructor when creating
an instance of the ``MapClassLoader`` class::

require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader';
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader.php';

$mapping = array(
'Foo' => '/path/to/Foo',
Expand Down
5 changes: 5 additions & 0 deletions components/console/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ the wheel, it uses the Symfony EventDispatcher component to do the work::
$application->setDispatcher($dispatcher);
$application->run();

.. caution::

Console events are only triggered by the main command being executed.
Commands called by the main command will not trigger any event.

The ``ConsoleEvents::COMMAND`` Event
------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions components/console/helpers/questionhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ In this case, the user will be asked "Continue with this action?". If the user
answers with ``y`` it returns ``true`` or ``false`` if they answer with ``n``.
The second argument to
:method:`Symfony\\Component\\Console\\Question\\ConfirmationQuestion::__construct`
is the default value to return if the user doesn't enter any input. Any other
input will ask the same question again.
is the default value to return if the user doesn't enter any valid input. If
the second argument is not provided, ``true`` is assumed.

.. tip::

Expand Down
1 change: 1 addition & 0 deletions components/expression_language/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
// ...
$expression = new SerializedParsedExpression(
'1 + 4',
serialize($language->parse('1 + 4', array()))
);
Expand Down
2 changes: 1 addition & 1 deletion components/filesystem/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Filesystem Component

.. tip::

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

Installation
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Serving Files
When sending a file, you must add a ``Content-Disposition`` header to your
response. While creating this header for basic file downloads is easy, using
non-ASCII filenames is more involving. The
:method:`Symfony\\Component\\HttpFoundation\\Response::makeDisposition`
:method:`Symfony\\Component\\HttpFoundation\\ResponseHeaderBag::makeDisposition`
abstracts the hard work behind a simple API::

use Symfony\Component\HttpFoundation\ResponseHeaderBag;
Expand Down
2 changes: 1 addition & 1 deletion components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ recommended format. These files are parsed by one of the loader classes.
'symfony.is.great' => 'Symfony is great',
'symfony.is.amazing' => 'Symfony is amazing',
'symfony.has.bundles' => 'Symfony has bundles',
'user.login' => 'Login',
'user.login' => 'Login',
);
.. _component-translation-pluralization:
Expand Down
16 changes: 8 additions & 8 deletions components/yaml/yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ The following YAML is equivalent to the following PHP code:
.. code-block:: php
array(
'symfony 1.0' => array(
'PHP' => 5.0,
'Propel' => 1.2,
),
'symfony 1.2' => array(
'PHP' => 5.2,
'Propel' => 1.3,
),
'symfony 1.0' => array(
'PHP' => 5.0,
'Propel' => 1.2,
),
'symfony 1.2' => array(
'PHP' => 5.2,
'Propel' => 1.3,
),
);
There is one important thing you need to remember when using indentation in a
Expand Down
10 changes: 7 additions & 3 deletions cookbook/assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,16 @@ need to dump them manually. To do so, run the following:
This physically writes all of the asset files you need for your ``dev``
environment. The big disadvantage is that you need to run this each time
you update an asset. Fortunately, by passing the ``--watch`` option, the
command will automatically regenerate assets *as they change*:
you update an asset. Fortunately, by using the ``assetic:watch`` command,
assets will be regenerated automatically *as they change*:

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

Since running this command in the ``dev`` environment may generate a bunch
of files, it's usually a good idea to point your generated asset files to
Expand Down
7 changes: 3 additions & 4 deletions cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ Bundle Name
-----------

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

A namespace becomes a bundle as soon as you add a bundle class to it. The
bundle class name must follow these simple rules:
Expand Down
9 changes: 4 additions & 5 deletions cookbook/cache/varnish.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ If you know for sure that the backend never uses sessions or basic
authentication, have varnish remove the corresponding header from requests to
prevent clients from bypassing the cache. In practice, you will need sessions
at least for some parts of the site, e.g. when using forms with
:ref:`CSRF Protection <forms-csrf>`. In this situation, make sure to only
start a session when actually needed, and clear the session when it is no
longer needed. Alternatively, you can look into :doc:`../cache/form_csrf_caching`.

.. 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
:ref:`CSRF Protection <forms-csrf>`. In this situation, make sure to
:doc:`only start a session when actually needed </cookbook/session/avoid_session_start>`
and clear the session when it is no longer needed. Alternatively, you can look
into :doc:`/cookbook/cache/form_csrf_caching`.

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

0 comments on commit 4dd1f25

Please sign in to comment.