Skip to content

Commit

Permalink
Merge branch '2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 19, 2015
2 parents 71d51f8 + e406c3b commit d7ae2a0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
10 changes: 6 additions & 4 deletions book/forms.rst
Expand Up @@ -354,7 +354,9 @@ object.

.. code-block:: php-annotations
// AppBundle/Entity/Task.php
// src/AppBundle/Entity/Task.php
namespace AppBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Task
Expand All @@ -373,7 +375,7 @@ object.
.. code-block:: yaml
# AppBundle/Resources/config/validation.yml
# src/AppBundle/Resources/config/validation.yml
AppBundle\Entity\Task:
properties:
task:
Expand All @@ -384,7 +386,7 @@ object.
.. code-block:: xml
<!-- AppBundle/Resources/config/validation.xml -->
<!-- src/AppBundle/Resources/config/validation.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -404,7 +406,7 @@ object.
.. code-block:: php
// AppBundle/Entity/Task.php
// src/AppBundle/Entity/Task.php
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Type;
Expand Down
2 changes: 1 addition & 1 deletion book/validation.rst
Expand Up @@ -537,7 +537,7 @@ class to have at least 3 characters.

.. code-block:: php-annotations
// AppBundle/Entity/Author.php
// src/AppBundle/Entity/Author.php
// ...
use Symfony\Component\Validator\Constraints as Assert;
Expand Down
5 changes: 2 additions & 3 deletions components/dom_crawler.rst
Expand Up @@ -28,9 +28,8 @@ Usage
The :class:`Symfony\\Component\\DomCrawler\\Crawler` class provides methods
to query and manipulate HTML and XML documents.

An instance of the Crawler represents a set (:phpclass:`SplObjectStorage`)
of :phpclass:`DOMElement` objects, which are basically nodes that you can
traverse easily::
An instance of the Crawler represents a set of :phpclass:`DOMElement` objects,
which are basically nodes that you can traverse easily::

use Symfony\Component\DomCrawler\Crawler;

Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/environments.rst
Expand Up @@ -328,7 +328,7 @@ The new environment is now accessible via::
aren't accessible, the front controller is usually protected from external
IP addresses via the following code at the top of the controller::

if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))) {
die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

Expand Down
22 changes: 11 additions & 11 deletions cookbook/doctrine/registration_form.rst
Expand Up @@ -28,10 +28,10 @@ Your ``User`` entity will probably at least have the following fields:
A nice piece of information to collect. You can also allow users to
:ref:`login via email <registration-form-via-email>`.

* ``password``
``password``
The encoded password.

* ``plainPassword``
``plainPassword``
This field is *not* persisted: (notice no ``@ORM\Column`` above it). It
temporarily stores the plain password from the registration form. This field
can be validated then used to populate the ``password`` field.
Expand All @@ -49,7 +49,7 @@ With some validation added, your class may look something like this::
/**
* @ORM\Entity
* @UniqueEntity(fields="email", message="Email already taken")
* @UniqueEntity(fields="username", message="Username already taken")
* @UniqueEntity(fields="username", message="Username already taken")
*/
class User implements UserInterface
{
Expand Down Expand Up @@ -163,8 +163,8 @@ Next, create the form for the ``User`` entity::
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', 'email');
->add('username', 'text');
->add('email', 'email')
->add('username', 'text')
->add('plainPassword', 'repeated', array(
'type' => 'password',
'first_options' => array('label' => 'Password'),
Expand Down Expand Up @@ -245,7 +245,7 @@ controller for displaying the registration form::

If you decide to NOT use annotation routing (shown above), then you'll
need to create a route to this controller:

.. configuration-block::

.. code-block:: yaml
Expand Down Expand Up @@ -288,7 +288,7 @@ Next, create the template:
.. code-block:: html+jinja

{# app/Resources/views/registration/register.html.twig #}

{{ form_start(form) }}
{{ form_row('form.username') }}
{{ form_row('form.email') }}
Expand All @@ -297,7 +297,7 @@ Next, create the template:

<button type="submit">Register!</button>
{{ form_end(form) }}

.. code-block:: html+php

<!-- app/Resources/views/registration/register.html.php -->
Expand Down Expand Up @@ -362,12 +362,12 @@ registration form. The only trick is that you want to add this field to your for
without adding an unnecessary new ``termsAccepted`` property to your ``User`` entity
that you'll never need.

To do this, add a ``termsAccepted`` field to your form, but set its :ref:`mapped <reference-form-option-mapped>`
option to ``false``::
To do this, add a ``termsAccepted`` field to your form, but set its
:ref:`mapped <reference-form-option-mapped>` option to ``false``::

// src/AppBundle/Form/UserType.php
// ...
use Symfony\\Component\\Validator\\Constraints\\IsTrue;
use Symfony\Component\Validator\Constraints\IsTrue;

class UserType extends AbstractType
{
Expand Down
10 changes: 5 additions & 5 deletions cookbook/security/access_control.rst
Expand Up @@ -178,7 +178,7 @@ pattern so that it is only accessible by requests from the local server itself:
# ...
access_control:
#
- { path: ^/internal, roles: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] }
- { path: ^/internal, roles: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, fe80::1, ::1] }
- { path: ^/internal, roles: ROLE_NO_ACCESS }
.. code-block:: xml
Expand All @@ -195,7 +195,7 @@ pattern so that it is only accessible by requests from the local server itself:
<!-- ... -->
<rule path="^/internal"
role="IS_AUTHENTICATED_ANONYMOUSLY"
ips="127.0.0.1, ::1"
ips="127.0.0.1, fe80::1, ::1"
/>
<rule path="^/internal" role="ROLE_NO_ACCESS" />
Expand All @@ -211,7 +211,7 @@ pattern so that it is only accessible by requests from the local server itself:
array(
'path' => '^/internal',
'role' => 'IS_AUTHENTICATED_ANONYMOUSLY',
'ips' => '127.0.0.1, ::1'
'ips' => '127.0.0.1, fe80::1, ::1'
),
array(
'path' => '^/internal',
Expand All @@ -232,8 +232,8 @@ the external IP address ``10.0.0.1``:
that does not match an existing role, it just serves as a trick to always
deny access).

But if the same request comes from ``127.0.0.1`` or ``::1`` (the IPv6 loopback
address):
But if the same request comes from ``127.0.0.1``, ``::1`` (the IPv6 loopback
address) or ``fe80::1`` (the IPv6 link-local address):

* Now, the first access control rule is enabled as both the ``path`` and the
``ip`` match: access is allowed as the user always has the
Expand Down
2 changes: 1 addition & 1 deletion cookbook/security/voters.rst
Expand Up @@ -29,7 +29,7 @@ authorization checker (i.e. the ``security.authorization_checker`` service). Eac
one decides if the current user should have access to some resource.

Ultimately, Symfony takes the responses from all voters and makes the final
decission (to allow or deny access to the resource) according to the strategy defined
decision (to allow or deny access to the resource) according to the strategy defined
in the application, which can be: affirmative, consensus or unanimous.

For more information take a look at
Expand Down
5 changes: 2 additions & 3 deletions reference/constraints/UniqueEntity.rst
Expand Up @@ -33,7 +33,7 @@ your user table:

.. code-block:: php-annotations
// AppBundle/Entity/Author.php
// src/AppBundle/Entity/Author.php
namespace AppBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -89,8 +89,7 @@ your user table:
.. code-block:: php
// AppBundle/Entity/User.php
// src/AppBundle/Entity/User.php
namespace AppBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down

0 comments on commit d7ae2a0

Please sign in to comment.