Skip to content

Commit

Permalink
Merge branch '2.5' into 2.6
Browse files Browse the repository at this point in the history
* 2.5:
  Fix for symfony code standards
  Ref symfony#3903 - Normalize methods listings
  drop varnish 2 example from varnish cookbook article
  Rewrite the varnish cookbook article
  Fixes and tweaks
  Change PHPUnit link to avoid redirect to homepage
  Harmonize PHPUnit version to 4.2 or above
  Remove redundant "default" connection.
  More tweaks and grammar fixes
  Rewordings and transformed a list into a definition list
  More grammar fixes
  Minor grammar fix
  Fixed some errors in the explanation
  Documented the console environment variables
  update ordered list syntax
  Add  missing autoload include in basic application example
  Added cache_busting to default asset config
  • Loading branch information
weaverryan committed Dec 23, 2014
2 parents 0e45e29 + ce74c31 commit b45313a
Show file tree
Hide file tree
Showing 19 changed files with 277 additions and 335 deletions.
23 changes: 13 additions & 10 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,19 @@ helper functions:

That's it! Just three lines are needed to render the complete form:

* ``form_start(form)`` - Renders the start tag of the form, including the
correct enctype attribute when using file uploads;

* ``form_widget(form)`` - Renders all of the fields, which includes the field
element itself, a label and any validation error messages for the field;

* ``form_end()`` - Renders the end tag of the form and any fields that have not
yet been rendered, in case you rendered each field yourself. This is useful
for rendering hidden fields and taking advantage of the automatic
:ref:`CSRF Protection <forms-csrf>`.
``form_start(form)``
Renders the start tag of the form, including the correct enctype attribute
when using file uploads.

``form_widget(form)``
Renders all of the fields, which includes the field element itself, a label
and any validation error messages for the field.

``form_end()``
Renders the end tag of the form and any fields that have not
yet been rendered, in case you rendered each field yourself. This is useful
for rendering hidden fields and taking advantage of the automatic
:ref:`CSRF Protection <forms-csrf>`.

.. seealso::

Expand Down
6 changes: 3 additions & 3 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,13 @@ Imagine that the user's locale is ``fr_FR`` and that you're translating the
key ``Symfony is great``. To find the French translation, Symfony actually
checks translation resources for several different locales:

1. First, Symfony looks for the translation in a ``fr_FR`` translation resource
#. First, Symfony looks for the translation in a ``fr_FR`` translation resource
(e.g. ``messages.fr_FR.xliff``);

2. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
#. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
resource (e.g. ``messages.fr.xliff``);

3. If the translation still isn't found, Symfony uses the ``fallback`` configuration
#. If the translation still isn't found, Symfony uses the ``fallback`` configuration
parameter, which defaults to ``en`` (see `Configuration`_).

.. versionadded:: 2.6
Expand Down
2 changes: 2 additions & 0 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ an ``Application`` and adds commands to it::
<?php
// application.php

require __DIR__.'/vendor/autoload.php';

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

Expand Down
120 changes: 60 additions & 60 deletions components/http_foundation/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ Session Attributes
Returns true if the attribute exists.

:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::replace`
Sets multiple attributes at once: takes a keyed array and sets each key => value pair;
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.

:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::remove`
Deletes an attribute by key;
Deletes an attribute by key.

:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::clear`
Clear all attributes.
Expand All @@ -123,7 +123,7 @@ an array. A few methods exist for "Bag" management:

:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getBag`
Gets a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` by
bag name;
bag name.

:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getFlashBag`
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
Expand Down Expand Up @@ -157,16 +157,16 @@ bag types if necessary.
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` has
the following API which is intended mainly for internal purposes:

* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`:
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
Generally this value can be left at its default and is for internal use.
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
Generally this value can be left at its default and is for internal use.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`:
This is called internally by Symfony session storage classes to link bag data
to the session.
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`
This is called internally by Symfony session storage classes to link bag data
to the session.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`:
Returns the name of the session bag.
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`
Returns the name of the session bag.

Attributes
~~~~~~~~~~
Expand All @@ -175,11 +175,11 @@ The purpose of the bags implementing the :class:`Symfony\\Component\\HttpFoundat
is to handle session attribute storage. This might include things like user ID,
and remember me login settings or other user based state information.

* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
This is the standard default implementation.
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
This is the standard default implementation.

* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
This implementation allows for attributes to be stored in a structured namespace.
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
This implementation allows for attributes to be stored in a structured namespace.

Any plain key-value storage system is limited in the extent to which
complex data can be stored since each key must be unique. You can achieve
Expand Down Expand Up @@ -210,29 +210,29 @@ This way you can easily access a key within the stored array directly and easily
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface`
has a simple API

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`:
Sets an attribute by key;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`
Sets an attribute by key.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`:
Gets an attribute by key;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`
Gets an attribute by key.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`:
Gets all attributes as an array of key => value;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`
Gets all attributes as an array of key => value.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`:
Returns true if the attribute exists;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`
Returns true if the attribute exists.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`:
Returns an array of stored attribute keys;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`
Returns an array of stored attribute keys.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`:
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`:
Deletes an attribute by key;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`
Deletes an attribute by key.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`:
Clear the bag;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`
Clear the bag.

Flash Messages
~~~~~~~~~~~~~~
Expand All @@ -246,49 +246,49 @@ updated page or an error page. Flash messages set in the previous page request
would be displayed immediately on the subsequent page load for that session.
This is however just one application for flash messages.

* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
In this implementation, messages set in one page-load will
be available for display only on the next page load. These messages will auto
expire regardless of if they are retrieved or not.
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
In this implementation, messages set in one page-load will
be available for display only on the next page load. These messages will auto
expire regardless of if they are retrieved or not.

* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
In this implementation, messages will remain in the session until
they are explicitly retrieved or cleared. This makes it possible to use ESI
caching.
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
In this implementation, messages will remain in the session until
they are explicitly retrieved or cleared. This makes it possible to use ESI
caching.

:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
has a simple API

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`:
Adds a flash message to the stack of specified type;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`
Adds a flash message to the stack of specified type.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`:
Sets flashes by type; This method conveniently takes both single messages as
a ``string`` or multiple messages in an ``array``.
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`
Sets flashes by type; This method conveniently takes both single messages as
a ``string`` or multiple messages in an ``array``.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`:
Gets flashes by type and clears those flashes from the bag;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`
Gets flashes by type and clears those flashes from the bag.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`:
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`:
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`:
Gets flashes by type (read only);
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`
Gets flashes by type (read only).

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`:
Gets all flashes (read only) as keyed array of arrays;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`
Gets all flashes (read only) as keyed array of arrays.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`:
Returns true if the type exists, false if not;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`
Returns true if the type exists, false if not.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`:
Returns an array of the stored flash types;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`
Returns an array of the stored flash types.

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`:
Clears the bag;
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`
Clears the bag.

For simple applications it is usually sufficient to have one flash message per
type, for example a confirmation notice after a form is submitted. However,
Expand Down
14 changes: 7 additions & 7 deletions components/routing/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ Defining Routes

A full route definition can contain up to seven parts:

1. The URL path route. This is matched against the URL passed to the `RequestContext`,
#. The URL path route. This is matched against the URL passed to the `RequestContext`,
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
to match dynamic parts in the URL.

2. An array of default values. This contains an array of arbitrary values
#. An array of default values. This contains an array of arbitrary values
that will be returned when the request matches the route.

3. An array of requirements. These define constraints for the values of the
#. An array of requirements. These define constraints for the values of the
placeholders as regular expressions.

4. An array of options. These contain internal settings for the route and
#. An array of options. These contain internal settings for the route and
are the least commonly needed.

5. A host. This is matched against the host of the request. See
#. A host. This is matched against the host of the request. See
:doc:`/components/routing/hostname_pattern` for more details.

6. An array of schemes. These enforce a certain HTTP scheme (``http``, ``https``).
#. An array of schemes. These enforce a certain HTTP scheme (``http``, ``https``).

7. An array of methods. These enforce a certain HTTP request method (``HEAD``,
#. An array of methods. These enforce a certain HTTP request method (``HEAD``,
``GET``, ``POST``, ...).

Take the following route, which combines several of these ideas::
Expand Down
12 changes: 6 additions & 6 deletions components/security/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ itself depends on multiple voters, and makes a final verdict based on all
the votes (either positive, negative or neutral) it has received. It
recognizes several strategies:

* ``affirmative`` (default)
``affirmative`` (default)
grant access as soon as any voter returns an affirmative response;

* ``consensus``
``consensus``
grant access if there are more voters granting access than there are denying;

* ``unanimous``
``unanimous``
only grant access if none of the voters has denied access;

.. code-block:: php
Expand Down Expand Up @@ -90,14 +90,14 @@ of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterf
which means they have to implement a few methods which allows the decision
manager to use them:

* ``supportsAttribute($attribute)``
``supportsAttribute($attribute)``
will be used to check if the voter knows how to handle the given attribute;

* ``supportsClass($class)``
``supportsClass($class)``
will be used to check if the voter is able to grant or deny access for
an object of the given class;

* ``vote(TokenInterface $token, $object, array $attributes)``
``vote(TokenInterface $token, $object, array $attributes)``
this method will do the actual voting and return a value equal to one
of the class constants of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface`,
i.e. ``VoterInterface::ACCESS_GRANTED``, ``VoterInterface::ACCESS_DENIED``
Expand Down
6 changes: 3 additions & 3 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ of the ``Person`` class would be encoded in XML format::
In this case, :method:`Symfony\\Component\\Serializer\\Serializer::deserialize`
needs three parameters:

1. The information to be decoded
2. The name of the class this information will be decoded to
3. The encoder used to convert that information into an array
#. The information to be decoded
#. The name of the class this information will be decoded to
#. The encoder used to convert that information into an array

Using Camelized Method Names for Underscored Attributes
-------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions components/translation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ If the message is not located in the catalog of the specific locale, the
translator will look into the catalog of one or more fallback locales. For
example, assume you're trying to translate into the ``fr_FR`` locale:

1. First, the translator looks for the translation in the ``fr_FR`` locale;
#. First, the translator looks for the translation in the ``fr_FR`` locale;

2. If it wasn't found, the translator looks for the translation in the ``fr``
#. If it wasn't found, the translator looks for the translation in the ``fr``
locale;

3. If the translation still isn't found, the translator uses the one or more
#. If the translation still isn't found, the translator uses the one or more
fallback locales set explicitly on the translator.

For (3), the fallback locales can be set by calling
Expand Down
2 changes: 0 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)
lexers['varnish2'] = CLexer()
lexers['varnish3'] = CLexer()
lexers['varnish4'] = CLexer()

config_block = {
'varnish2': 'Varnish 2',
'varnish3': 'Varnish 3',
'varnish4': 'Varnish 4'
}
Expand Down
3 changes: 2 additions & 1 deletion contributing/code/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ software:

* Git;
* PHP version 5.3.3 or above;
* PHPUnit 3.6.4 or above.
* `PHPUnit`_ 4.2 or above.

Configure Git
~~~~~~~~~~~~~
Expand Down Expand Up @@ -415,3 +415,4 @@ messages of all the commits. When you are finished, execute the push command.
.. _`fabbot`: http://fabbot.io
.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/
.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/
.. _PHPUnit: https://phpunit.de/manual/current/en/installation.html
Loading

0 comments on commit b45313a

Please sign in to comment.