Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
* origin/master: (93 commits)
  [#5623] don't configure default constraint message
  [Validator] added BIC validator
  Update links
  Added September changelog
  Added September changelog
  Misspelling
  [#5689] Some minor syntax fixes
  [DI] Add some documentation for the deprecation feature
  Info about implicit session start
  Revert "[#5771] remove another Response constant"
  Revert "Remove not existing response constant"
  [#5771] remove another Response constant
  [#5761] add versionadded directive
  Fixed two typos
  Remember me, Renamed key to secret
  translations have been removed from symfony.com
  Remove not existing response constant
  Update HttpFoundation note after recent changes in routing component
  [#5584] language tweak and XML config fix
  Add DebugBundle config reference
  ...
  • Loading branch information
weaverryan committed Oct 14, 2015
2 parents 9f8d766 + b13593e commit a0b06ae
Show file tree
Hide file tree
Showing 111 changed files with 1,439 additions and 1,070 deletions.
6 changes: 3 additions & 3 deletions _theme/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
<div id="sidebar" class="col-sm-3">
<div id="sidebar-content">
<div id="demo-warning">
<h4>This is a demo</h4>
<p>This is a demo provided by platform.sh.<br>
<a href="http://symfony.com/doc/current/{{ pagename }}">Visit on symfony.com</a>.</p>
<h4>Pull request build</h4>
<p>Each pull request of the Symfony Documentation is automatically deployed and hosted on <a href="https://platform.sh">Platform.sh</a>.<br>
View this page on <a href="https://symfony.com/doc/current/{{ pagename }}">symfony.com</a>.</p>
</div>

{%- include "globaltoc.html" %}
Expand Down
18 changes: 13 additions & 5 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ session.
Flash Messages
~~~~~~~~~~~~~~

You can also store small messages that will be stored on the user's session
for exactly one additional request. This is useful when processing a form:
You can also store small messages that will be stored on the user's session.
This is useful when processing a form:
you want to redirect and have a special message shown on the *next* page.
These types of messages are called "flash" messages.

Expand Down Expand Up @@ -675,9 +675,17 @@ the ``notice`` message:
</div>
<?php endforeach ?>

By design, flash messages are meant to live for exactly one request (they're
"gone in a flash"). They're designed to be used across redirects exactly as
you've done in this example.
.. note::

By design, flash messages are meant to be processed exactly once. This means
that they vanish from the session automatically when they are retrieved from
the flash bag by calling the ``get()`` method.

.. tip::

You can use the
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`
method instead to retrieve the message while keeping it in the bag.

.. index::
single: Controller; Response object
Expand Down
19 changes: 16 additions & 3 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,21 @@ controller::
$form->handleRequest($request);

if ($form->isValid()) {
// perform some action, such as saving the task to the database
// ... perform some action, such as saving the task to the database

return $this->redirectToRoute('task_success');
}

// ...
return $this->render('default/new.html.twig', array(
'form' => $form->createView(),
));
}
.. caution::

Be aware that the ``createView()`` method should be called *after* ``handleRequest``
is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the
view (like validation errors).

.. versionadded:: 2.3
The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` method
Expand Down Expand Up @@ -1774,6 +1782,11 @@ The ``_token`` field is a hidden field and will be automatically rendered
if you include the ``form_end()`` function in your template, which ensures
that all un-rendered fields are output.

.. caution::

Since the token is stored in the session, a session is started automatically
as soon as you render a form with CSRF protection.

The CSRF token can be customized on a form-by-form basis. For example::

use Symfony\Component\OptionsResolver\OptionsResolver;
Expand Down Expand Up @@ -1953,7 +1966,7 @@ Learn more from the Cookbook
* :doc:`/cookbook/security/csrf_in_login_form`
* :doc:`/cookbook/cache/form_csrf_caching`

.. _`Symfony Form component`: https://github.com/symfony/Form
.. _`Symfony Form component`: https://github.com/symfony/form
.. _`DateTime`: http://php.net/manual/en/class.datetime.php
.. _`Twig Bridge`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Twig
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Expand Down
4 changes: 2 additions & 2 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ Learn more from the Cookbook

.. _`Doctrine`: http://www.doctrine-project.org
.. _`download Composer`: https://getcomposer.org/download/
.. _`Routing`: https://github.com/symfony/Routing
.. _`Templating`: https://github.com/symfony/Templating
.. _`Routing`: https://github.com/symfony/routing
.. _`Templating`: https://github.com/symfony/templating
.. _`KnpBundles.com`: http://knpbundles.com/
.. _`Twig`: http://twig.sensiolabs.org
.. _`Varnish`: https://www.varnish-cache.org/
Expand Down
8 changes: 5 additions & 3 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Here is a list of the main options:
``allow_revalidate``
Specifies whether the client can force a cache revalidate by including a
``Cache-Control`` "max-age=0" directive in the request. Set it to ``true`` for
compliance with RFC 2616 (default: false).
compliance with RFC 2616 (default: ``false``).

``stale_while_revalidate``
Specifies the default number of seconds (the granularity is the second as the
Expand Down Expand Up @@ -651,6 +651,7 @@ header value::
namespace AppBundle\Controller;

// ...
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Entity\Article;

Expand All @@ -665,6 +666,7 @@ header value::

$date = $authorDate > $articleDate ? $authorDate : $articleDate;

$response = new Response();
$response->setLastModified($date);
// Set response as public. Otherwise it will be private by default.
$response->setPublic();
Expand Down Expand Up @@ -880,8 +882,8 @@ that data from its cache.

If you want to use cache invalidation, have a look at the
`FOSHttpCacheBundle`_. This bundle provides services to help with various
cache invalidation concepts, and also documents the configuration for the
a couple of common caching proxies.
cache invalidation concepts and also documents the configuration for a
couple of common caching proxies.

If one content corresponds to one URL, the ``PURGE`` model works well.
You send a request to the cache proxy with the HTTP method ``PURGE`` (using
Expand Down
2 changes: 1 addition & 1 deletion book/http_fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,5 +579,5 @@ sensible defaults. For more advanced users, the sky is the limit.
.. _`List of HTTP status codes`: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
.. _`List of HTTP header fields`: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
.. _`List of common media types`: https://www.iana.org/assignments/media-types/media-types.xhtml
.. _`Validator`: https://github.com/symfony/Validator
.. _`Validator`: https://github.com/symfony/validator
.. _`Swift Mailer`: http://swiftmailer.org/
4 changes: 2 additions & 2 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ If there are any issues, correct them now before moving on.
$ rm -rf app/cache/*
$ rm -rf app/logs/*
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
Expand All @@ -254,7 +254,7 @@ If there are any issues, correct them now before moving on.

.. code-block:: bash
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
Expand Down
2 changes: 1 addition & 1 deletion book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ else, you'll want to encode their passwords. The best algorithm to use is
.. include:: /cookbook/security/_ircmaxwell_password-compat.rst.inc

Of course, your user's passwords now need to be encoded with this exact algorithm.
Of course, your users' passwords now need to be encoded with this exact algorithm.
For hardcoded users, you can use an `online tool`_, which will give you something
like this:

Expand Down
2 changes: 1 addition & 1 deletion book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ use somewhere in your application::
public $name;
}

Add constraints though any of the supported methods. Set the message option to the
Add constraints through any of the supported methods. Set the message option to the
translation source text. For example, to guarantee that the ``$name`` property is
not empty, add the following:

Expand Down
24 changes: 12 additions & 12 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -734,19 +734,19 @@ user registers and when a user updates their contact information later:
class User implements UserInterface
{
/**
* @Assert\Email(groups={"registration"})
*/
* @Assert\Email(groups={"registration"})
*/
private $email;
/**
* @Assert\NotBlank(groups={"registration"})
* @Assert\Length(min=7, groups={"registration"})
*/
* @Assert\NotBlank(groups={"registration"})
* @Assert\Length(min=7, groups={"registration"})
*/
private $password;
/**
* @Assert\Length(min=2)
*/
* @Assert\Length(min=2)
*/
private $city;
}
Expand Down Expand Up @@ -927,13 +927,13 @@ username and the password are different only if all other validation passes
class User implements UserInterface
{
/**
* @Assert\NotBlank
*/
* @Assert\NotBlank
*/
private $username;
/**
* @Assert\NotBlank
*/
* @Assert\NotBlank
*/
private $password;
/**
Expand Down Expand Up @@ -1300,5 +1300,5 @@ Learn more from the Cookbook

* :doc:`/cookbook/validation/custom_constraint`

.. _Validator: https://github.com/symfony/Validator
.. _Validator: https://github.com/symfony/validator
.. _JSR303 Bean Validation specification: http://jcp.org/en/jsr/detail?id=303
57 changes: 57 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,63 @@ documentation.
Do you also want to participate in the Symfony Documentation? Take a look
at the ":doc:`/contributing/documentation/overview`" article.

September, 2015
---------------

New Documentation
~~~~~~~~~~~~~~~~~

* `#5555 <https://github.com/symfony/symfony-docs/pull/5555>`_ added result yaml and xml from example code (OskarStark)
* `#5631 <https://github.com/symfony/symfony-docs/pull/5631>`_ Updated the Quick Tour to the latest changes introduced by Symfony (javiereguiluz)
* `#5497 <https://github.com/symfony/symfony-docs/pull/5497>`_ Simplified the Quick tour explanation about Symfony Installation (DQNEO)

Fixed Documentation
~~~~~~~~~~~~~~~~~~~

* `#5629 <https://github.com/symfony/symfony-docs/pull/5629>`_ Fixing web user permission (BenoitLeveque)
* `#5673 <https://github.com/symfony/symfony-docs/pull/5673>`_ Update http_cache.rst (szyszka90)
* `#5666 <https://github.com/symfony/symfony-docs/pull/5666>`_ Fix EntityManager namespace (JhonnyL)
* `#5656 <https://github.com/symfony/symfony-docs/pull/5656>`_ Fix monolog line formatter in logging cookbook example. (vmarquez)
* `#5507 <https://github.com/symfony/symfony-docs/pull/5507>`_ Path fixed (carlosreig)

Minor Documentation Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* `#5740 <https://github.com/symfony/symfony-docs/pull/5740>`_ Fix typo in PdoSessionHandler Documentation (tobemedia)
* `#5719 <https://github.com/symfony/symfony-docs/pull/5719>`_ changed repo names to the new ones (fabpot)
* `#5227 <https://github.com/symfony/symfony-docs/pull/5227>`_ [Cookbook] Fix doc on Generic Form Type Extensions (lemoinem)
* `#5703 <https://github.com/symfony/symfony-docs/pull/5703>`_ comment old logic (OskarStark)
* `#5683 <https://github.com/symfony/symfony-docs/pull/5683>`_ Improve the demo-warning. (GuGuss)
* `#5690 <https://github.com/symfony/symfony-docs/pull/5690>`_ Updated the release process image (javiereguiluz)
* `#5188 <https://github.com/symfony/symfony-docs/pull/5188>`_ Updated Cookies & Caching section (lukey78)
* `#5710 <https://github.com/symfony/symfony-docs/pull/5710>`_ Fix grammar mistake in security.rst (zatikbalazs)
* `#5706 <https://github.com/symfony/symfony-docs/pull/5706>`_ Update assetic.rst (Acinonux)
* `#5705 <https://github.com/symfony/symfony-docs/pull/5705>`_ Update assetic.rst (Acinonux)
* `#5685 <https://github.com/symfony/symfony-docs/pull/5685>`_ Fix indentation in some annotations (iamdto)
* `#5704 <https://github.com/symfony/symfony-docs/pull/5704>`_ Fix typo in translation.rst (zatikbalazs)
* `#5701 <https://github.com/symfony/symfony-docs/pull/5701>`_ Update testing.rst (hansallis)
* `#5711 <https://github.com/symfony/symfony-docs/pull/5711>`_ removed service call from controller (sloba88)
* `#5692 <https://github.com/symfony/symfony-docs/pull/5692>`_ Made a sentence slightly more english (GTheron)
* `#5715 <https://github.com/symfony/symfony-docs/pull/5715>`_ Add missing code tag (zatikbalazs)
* `#5720 <https://github.com/symfony/symfony-docs/pull/5720>`_ adding closing tag (InfoTracer)
* `#5714 <https://github.com/symfony/symfony-docs/pull/5714>`_ Remove unnecessary word from http_cache.rst (zatikbalazs)
* `#5680 <https://github.com/symfony/symfony-docs/pull/5680>`_ fix grammar mistake (greg0ire)
* `#5682 <https://github.com/symfony/symfony-docs/pull/5682>`_ Fix grammar and CS (iamdto)
* `#5652 <https://github.com/symfony/symfony-docs/pull/5652>`_ Do not use dynamic REQUEST_URI from $_SERVER as base url (senkal)
* `#5654 <https://github.com/symfony/symfony-docs/pull/5654>`_ Doc about new way of running tests (nicolas-grekas)
* `#5598 <https://github.com/symfony/symfony-docs/pull/5598>`_ [Cookbook][Security] proofread comments in voter article (xabbuh)
* `#5560 <https://github.com/symfony/symfony-docs/pull/5560>`_ [2.3] [Contributing] [CS] Added missing docblocks in code snippet (phansys)
* `#5674 <https://github.com/symfony/symfony-docs/pull/5674>`_ Update cookbook entries with best practices (JhonnyL)
* `#5675 <https://github.com/symfony/symfony-docs/pull/5675>`_ [Contributing] add a link to the testing section (xabbuh)
* `#5669 <https://github.com/symfony/symfony-docs/pull/5669>`_ Better explanation of implicit exception response status code (hvt)
* `#5651 <https://github.com/symfony/symfony-docs/pull/5651>`_ [Reference][Constraints] follow best practices in the constraints reference (xabbuh)
* `#5648 <https://github.com/symfony/symfony-docs/pull/5648>`_ Minor fixes for the QuestionHelper documentation (javiereguiluz)
* `#5641 <https://github.com/symfony/symfony-docs/pull/5641>`_ Move important information out of versionadded (WouterJ)
* `#5619 <https://github.com/symfony/symfony-docs/pull/5619>`_ Remove a caution note about StringUtils::equals() which is no longer true (javiereguiluz)
* `#5571 <https://github.com/symfony/symfony-docs/pull/5571>`_ Some small fixes for upload files article (WouterJ)
* `#5660 <https://github.com/symfony/symfony-docs/pull/5660>`_ Improved "Community Reviews" page (webmozart)


August, 2015
------------

Expand Down
2 changes: 1 addition & 1 deletion components/asset/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Installation
You can install the component in two different ways:

* :doc:`Install it via Composer </components/using_components>` (``symfony/asset`` on `Packagist`_);
* Use the official Git repository (https://github.com/symfony/Asset).
* Use the official Git repository (https://github.com/symfony/asset).

Usage
-----
Expand Down
2 changes: 1 addition & 1 deletion components/class_loader/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can install the component in 2 different ways:

* :doc:`Install it via Composer </components/using_components>` (``symfony/class-loader``
on `Packagist`_);
* Use the official Git repository (https://github.com/symfony/ClassLoader).
* Use the official Git repository (https://github.com/symfony/class-loader).

.. include:: /components/require_autoload.rst.inc

Expand Down
41 changes: 41 additions & 0 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,47 @@ tree with ``append()``::
This is also useful to help you avoid repeating yourself if you have sections
of the config that are repeated in different places.

The example results in the following:

.. configuration-block::

.. code-block:: yaml
database:
connection:
driver: ~ # Required
host: localhost
username: ~
password: ~
memory: false
parameters: # Required
# Prototype
name:
value: ~ # Required
.. code-block:: xml
<database>
<!-- driver: Required -->
<connection
driver=""
host="localhost"
username=""
password=""
memory="false"
>
<!-- prototype -->
<!-- value: Required -->
<parameters
name="parameters name"
value=""
/>
</connection>
</database>
.. _component-config-normalization:

Normalization
Expand Down
2 changes: 1 addition & 1 deletion components/config/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can install the component in 2 different ways:

* :doc:`Install it via Composer </components/using_components>` (``symfony/config``
on `Packagist`_);
* Use the official Git repository (https://github.com/symfony/Config).
* Use the official Git repository (https://github.com/symfony/config).

.. include:: /components/require_autoload.rst.inc

Expand Down
6 changes: 5 additions & 1 deletion components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ you can also set the current progress by calling the
Prior to version 2.6, the progress bar only works if your platform
supports ANSI codes; on other platforms, no output is generated.

.. versionadded:: 2.6
.. tip::

If your platform doesn't support ANSI codes, updates to the progress
bar are added as new lines. To prevent the output from being flooded,
adjust the
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setRedrawFrequency`
accordingly. By default, when using a ``max``, the redraw frequency
is set to *10%* of your ``max``.

.. versionadded:: 2.6
The ``setRedrawFrequency()`` method was introduced in Symfony 2.6.

If you don't know the number of steps in advance, just omit the steps argument
when creating the :class:`Symfony\\Component\\Console\\Helper\\ProgressBar`
instance::
Expand Down
Loading

0 comments on commit a0b06ae

Please sign in to comment.