Skip to content

Commit fdae4bc

Browse files
committed
Merge branch 'master' of https://github.com/solazs/symfony-docs into patch-1
2 parents d5566b1 + 81e8c13 commit fdae4bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+143
-279
lines changed

Diff for: best_practices/forms.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ form in its own PHP class::
2121

2222
use Symfony\Component\Form\AbstractType;
2323
use Symfony\Component\Form\FormBuilderInterface;
24-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
24+
use Symfony\Component\OptionsResolver\OptionsResolver;
2525

2626
class PostType extends AbstractType
2727
{
@@ -36,7 +36,7 @@ form in its own PHP class::
3636
;
3737
}
3838

39-
public function setDefaultOptions(OptionsResolverInterface $resolver)
39+
public function configureOptions(OptionsResolver $resolver)
4040
{
4141
$resolver->setDefaults(array(
4242
'data_class' => 'AppBundle\Entity\Post'

Diff for: 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

Diff for: book/forms.rst

+21-17
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,17 @@ you'll need to specify which validation group(s) your form should use::
470470
'validation_groups' => array('registration'),
471471
))->add(...);
472472

473+
.. versionadded:: 2.7
474+
The ``configureOptions()`` method was introduced in Symfony 2.7. Previously,
475+
the method was called ``setDefaultOptions()``.
476+
473477
If you're creating :ref:`form classes <book-form-creating-form-classes>` (a
474-
good practice), then you'll need to add the following to the ``setDefaultOptions()``
478+
good practice), then you'll need to add the following to the ``configureOptions()``
475479
method::
476480

477-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
481+
use Symfony\Component\OptionsResolver\OptionsResolver;
478482

479-
public function setDefaultOptions(OptionsResolverInterface $resolver)
483+
public function configureOptions(OptionsResolver $resolver)
480484
{
481485
$resolver->setDefaults(array(
482486
'validation_groups' => array('registration'),
@@ -498,9 +502,9 @@ Disabling Validation
498502
Sometimes it is useful to suppress the validation of a form altogether. For
499503
these cases you can set the ``validation_groups`` option to ``false``::
500504

501-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
505+
use Symfony\Component\OptionsResolver\OptionsResolver;
502506

503-
public function setDefaultOptions(OptionsResolverInterface $resolver)
507+
public function configureOptions(OptionsResolver $resolver)
504508
{
505509
$resolver->setDefaults(array(
506510
'validation_groups' => false,
@@ -524,10 +528,10 @@ If you need some advanced logic to determine the validation groups (e.g.
524528
based on submitted data), you can set the ``validation_groups`` option
525529
to an array callback::
526530

527-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
531+
use Symfony\Component\OptionsResolver\OptionsResolver;
528532

529533
// ...
530-
public function setDefaultOptions(OptionsResolverInterface $resolver)
534+
public function configureOptions(OptionsResolver $resolver)
531535
{
532536
$resolver->setDefaults(array(
533537
'validation_groups' => array(
@@ -544,10 +548,10 @@ You can also define whole logic inline by using a ``Closure``::
544548

545549
use Acme\AcmeBundle\Entity\Client;
546550
use Symfony\Component\Form\FormInterface;
547-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
551+
use Symfony\Component\OptionsResolver\OptionsResolver;
548552

549553
// ...
550-
public function setDefaultOptions(OptionsResolverInterface $resolver)
554+
public function configureOptions(OptionsResolver $resolver)
551555
{
552556
$resolver->setDefaults(array(
553557
'validation_groups' => function(FormInterface $form) {
@@ -567,10 +571,10 @@ of the entity as well you have to adjust the option as follows::
567571

568572
use Acme\AcmeBundle\Entity\Client;
569573
use Symfony\Component\Form\FormInterface;
570-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
574+
use Symfony\Component\OptionsResolver\OptionsResolver;
571575

572576
// ...
573-
public function setDefaultOptions(OptionsResolverInterface $resolver)
577+
public function configureOptions(OptionsResolver $resolver)
574578
{
575579
$resolver->setDefaults(array(
576580
'validation_groups' => function(FormInterface $form) {
@@ -1090,9 +1094,9 @@ the choice is ultimately up to you.
10901094
good idea to explicitly specify the ``data_class`` option by adding the
10911095
following to your form type class::
10921096

1093-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1097+
use Symfony\Component\OptionsResolver\OptionsResolver;
10941098

1095-
public function setDefaultOptions(OptionsResolverInterface $resolver)
1099+
public function configureOptions(OptionsResolver $resolver)
10961100
{
10971101
$resolver->setDefaults(array(
10981102
'data_class' => 'AppBundle\Entity\Task',
@@ -1321,7 +1325,7 @@ create a form class so that a ``Category`` object can be modified by the user::
13211325

13221326
use Symfony\Component\Form\AbstractType;
13231327
use Symfony\Component\Form\FormBuilderInterface;
1324-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1328+
use Symfony\Component\OptionsResolver\OptionsResolver;
13251329

13261330
class CategoryType extends AbstractType
13271331
{
@@ -1330,7 +1334,7 @@ create a form class so that a ``Category`` object can be modified by the user::
13301334
$builder->add('name');
13311335
}
13321336

1333-
public function setDefaultOptions(OptionsResolverInterface $resolver)
1337+
public function configureOptions(OptionsResolver $resolver)
13341338
{
13351339
$resolver->setDefaults(array(
13361340
'data_class' => 'AppBundle\Entity\Category',
@@ -1756,13 +1760,13 @@ that all un-rendered fields are output.
17561760

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

1759-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1763+
use Symfony\Component\OptionsResolver\OptionsResolver;
17601764

17611765
class TaskType extends AbstractType
17621766
{
17631767
// ...
17641768

1765-
public function setDefaultOptions(OptionsResolverInterface $resolver)
1769+
public function configureOptions(OptionsResolver $resolver)
17661770
{
17671771
$resolver->setDefaults(array(
17681772
'data_class' => 'AppBundle\Entity\Task',

Diff for: book/installation.rst

+2-16
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ Using the Symfony Installer is the only recommended way to create new Symfony
1616
applications. This installer is a PHP application that has to be installed
1717
only once and then it can create any number of Symfony applications.
1818

19-
.. note::
20-
21-
The installer requires PHP 5.4 or higher. If you still use the legacy
22-
PHP 5.3 version, you cannot use the Symfony Installer. Read the
23-
:ref:`book-creating-applications-without-the-installer` section to learn how
24-
to proceed.
25-
2619
Depending on your operating system, the installer must be installed in different
2720
ways.
2821

@@ -107,9 +100,8 @@ to use for your projects.
107100
Creating Symfony Applications without the Installer
108101
---------------------------------------------------
109102

110-
If you still use PHP 5.3, or if you can't execute the installer for any reason,
111-
you can create Symfony applications using the alternative installation method
112-
based on `Composer`_.
103+
If you can't execute the installer for any reason, you can create Symfony
104+
applications using the alternative installation method based on `Composer`_.
113105

114106
Composer is the dependency manager used by modern PHP applications and it can
115107
also be used to create new applications based on the Symfony framework. If you
@@ -168,12 +160,6 @@ possible solutions depending on your operating system. All of them are
168160
explained in the :ref:`Setting up Permissions <book-installation-permissions>`
169161
section.
170162

171-
.. note::
172-
173-
PHP's internal web server is available in PHP 5.4 or higher versions. If you
174-
still use the legacy PHP 5.3 version, you'll have to configure a *virtual host*
175-
in your web server.
176-
177163
The ``server:run`` command is only suitable while developing the application. In
178164
order to run Symfony applications on production servers, you'll have to configure
179165
your `Apache`_ or `Nginx`_ web server as explained in

Diff for: book/security.rst

-10
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,6 @@ else, you'll want to encode their passwords. The best algorithm to use is
499499
// ...
500500
));
501501
502-
.. include:: /cookbook/security/_ircmaxwell_password-compat.rst.inc
503-
504502
Of course, your user's passwords now need to be encoded with this exact algorithm.
505503
For hardcoded users, you can use an `online tool`_, which will give you something
506504
like this:
@@ -824,9 +822,6 @@ You can easily deny access from inside a controller::
824822
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
825823
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
826824

827-
.. versionadded:: 2.5
828-
The ``createAccessDeniedException`` method was introduced in Symfony 2.5.
829-
830825
The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::createAccessDeniedException`
831826
method creates a special :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
832827
object, which ultimately triggers a 403 HTTP response inside Symfony.
@@ -1317,11 +1312,6 @@ cookie will be ever created by Symfony):
13171312
Checking for Known Security Vulnerabilities in Dependencies
13181313
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13191314

1320-
.. versionadded:: 2.5
1321-
The ``security:check`` command was introduced in Symfony 2.5. This command is
1322-
included in ``SensioDistributionBundle``, which has to be registered in your
1323-
application in order to use this command.
1324-
13251315
When using lots of dependencies in your Symfony projects, some of them may
13261316
contain security vulnerabilities. That's why Symfony includes a command called
13271317
``security:check`` that checks your ``composer.lock`` file to find any known

Diff for: book/templating.rst

-6
Original file line numberDiff line numberDiff line change
@@ -1021,9 +1021,6 @@ configuration option.
10211021

10221022
.. _`book-templating-version-by-asset`:
10231023

1024-
.. versionadded:: 2.5
1025-
Setting versioned URLs on an asset-by-asset basis was introduced in Symfony 2.5.
1026-
10271024
If you need to set a version for a specific asset, you can set the fourth
10281025
argument (or the ``version`` argument) to the desired version:
10291026

@@ -1046,9 +1043,6 @@ If you don't give a version or pass ``null``, the default package version
10461043
(from :ref:`ref-framework-assets-version`) will be used. If you pass ``false``,
10471044
versioned URL will be deactivated for this asset.
10481045

1049-
.. versionadded:: 2.5
1050-
Absolute URLs for assets were introduced in Symfony 2.5.
1051-
10521046
If you need absolute URLs for assets, you can set the third argument (or the
10531047
``absolute`` argument) to ``true``:
10541048

Diff for: book/translation.rst

+4-7
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ checks translation resources for several locales:
408408

409409
.. note::
410410

411-
When Symfony doesn't find a translation in the given locale, it will
412-
add the missing translation to the log file. For details,
411+
When Symfony doesn't find a translation in the given locale, it will
412+
add the missing translation to the log file. For details,
413413
see :ref:`reference-framework-translator-logging`.
414414

415415
.. _book-translation-user-locale:
@@ -683,15 +683,12 @@ Translating Database Content
683683
----------------------------
684684

685685
The translation of database content should be handled by Doctrine through
686-
the `Translatable Extension`_ or the `Translatable Behavior`_ (PHP 5.4+).
687-
For more information, see the documentation for these libraries.
686+
the `Translatable Extension`_ or the `Translatable Behavior`_. For more information,
687+
see the documentation for these libraries.
688688

689689
Debugging Translations
690690
----------------------
691691

692-
.. versionadded:: 2.5
693-
The ``debug:translation`` command was introduced in Symfony 2.5.
694-
695692
.. versionadded:: 2.6
696693
Prior to Symfony 2.6, this command was called ``translation:debug``.
697694

Diff for: book/validation.rst

-3
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,6 @@ allows you to add a constraint to any public method whose name starts with
586586
"get", "is" or "has". In this guide, these types of methods are referred to
587587
as "getters".
588588

589-
.. versionadded:: 2.5
590-
Support for methods starting with ``has`` was introduced in Symfony 2.5.
591-
592589
The benefit of this technique is that it allows you to validate your object
593590
dynamically. For example, suppose you want to make sure that a password field
594591
doesn't match the first name of the user (for security reasons). You can

Diff for: changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ New Documentation
2323
- `ad74169 <https://github.com/symfony/symfony-docs/commit/ad7416975bfca530b75bbebd29baa89eeeae5e51>`_ #4628 Varnish cookbook session cookie handling (dbu)
2424
- `50c5a9e <https://github.com/symfony/symfony-docs/commit/50c5a9e65de046fd8d719c7c7cc5233869f2643a>`_ #4895 Added configuration of the user provider (peterrehm)
2525
- `4226fc2 <https://github.com/symfony/symfony-docs/commit/4226fc27a06aeb975af1b1aae1e6207a07bbbb6f>`_ #4883 Global dump (nicolas-grekas)
26+
- `a57db5b <https://github.com/symfony/symfony-docs/commit/a57db5b1d240d5b6df1b5a8b077b280c17233420>`_ #4879 Documented true regex (WouterJ)
2627
- `3bb7b61 <https://github.com/symfony/symfony-docs/commit/3bb7b61dde079611180a2bc4e12e70eac8caef51>`_ #4645 Remove note that's no longer the case (thewilkybarkid)
28+
- `6c498d4 <https://github.com/symfony/symfony-docs/commit/6c498d4b0868b6dd940517d327c4f4a6893362fb>`_ #4805 added documentation for the new absolute_url() and relative_path() Twig functions (fabpot)
2729
- `3293286 <https://github.com/symfony/symfony-docs/commit/3293286ac82c6adb0cc4938fce33fef17f5f7108>`_ #4801 [Cookbook][cache][varnish] be more precise about version differences (dbu)
2830
- `572bf3b <https://github.com/symfony/symfony-docs/commit/572bf3b5da737731472f0760ee6105c72d76feb0>`_ #4800 [Cookbook][Security] Hint about createToken can return null (xelaris)
31+
- `74d2e30 <https://github.com/symfony/symfony-docs/commit/74d2e3063c23dadfcecd9c5d3715127da68da128>`_ #4786 Replaced setDefaultOptions by the new configureOptions method (peterrehm)
2932
- `528e8e1 <https://github.com/symfony/symfony-docs/commit/528e8e14aa690bf761d5ad4fa763593f856c6afb>`_ #4740 Use AppBundle whenever it's possible (javiereguiluz)
3033
- `08e5ac9 <https://github.com/symfony/symfony-docs/commit/08e5ac990a3d8e50a834bf5d7bfc420b39f9083a>`_ #4658 Debug formatter tweaks (weaverryan)
3134
- `cfad26c <https://github.com/symfony/symfony-docs/commit/cfad26c0b9227c3d43b4988b2c5e510625dd805c>`_ #4605 Adding a link to log things in the prod environment (weaverryan)
3235
- `3643ec2 <https://github.com/symfony/symfony-docs/commit/3643ec224921b3a0ce6163f807e4b208aa718d58>`_ #4723 [Cookbook][Security] document the new AuthenticationUtils (xabbuh)
3336
- `9742b92 <https://github.com/symfony/symfony-docs/commit/9742b9291e4b0f4ad4f1e8eff61261cc9598213f>`_ #4761 [Cookbook][Security] don't output message from AuthenticationException (xabbuh)
3437
- `a23e7d2 <https://github.com/symfony/symfony-docs/commit/a23e7d2ec1b28afe2c3452d1bf5488d7558a478a>`_ #4643 How to override vendor directory location (gajdaw)
38+
- `ca3b4c8 <https://github.com/symfony/symfony-docs/commit/ca3b4c8f34a30f8a396b5bf95fb801bf679fe20b>`_ #4753 bump Symfony requirements to PHP 5.5 (xabbuh)
3539
- `99aca45 <https://github.com/symfony/symfony-docs/commit/99aca4532681c1fbc5d85b2935145b3d4fe9934c>`_ #4749 [2.3][Book][Security] Add isPasswordValid doc as in 2.6 (xelaris)
3640
- `d9935a3 <https://github.com/symfony/symfony-docs/commit/d9935a3f918791a65488a0cd5ca721482c76f09e>`_ #4141 Notes about caching pages with a CSRF Form (ricardclau)
3741
- `207f2f0 <https://github.com/symfony/symfony-docs/commit/207f2f065e10a29172095c6b6f88a2d8fa071223>`_ #4711 [Reference] Add default_locale config description (xelaris)
@@ -57,6 +61,7 @@ Fixed Documentation
5761
- `5940d52 <https://github.com/symfony/symfony-docs/commit/5940d5252b82db7bc247c8723e7761c5cfc9c84b>`_ #4735 [BestPractices] remove @Security annotation for Symfony 2.3 (xabbuh)
5862
- `ce37b96 <https://github.com/symfony/symfony-docs/commit/ce37b96ba0565d0624a16c44c1447c248447158b>`_ #4771 [QuickTour] use the debug:router command name (xabbuh)
5963
- `ffe3425 <https://github.com/symfony/symfony-docs/commit/ffe3425f6a0ef97be45f29608c6be02db24e98f9>`_ #4765 [Book][Forms] avoid the request service where possible (xabbuh)
64+
- `92b10b1 <https://github.com/symfony/symfony-docs/commit/92b10b166cb7b0fb687f77804150d6c47aa9576f>`_ #4758 [Components][Yaml] don't describe removed usage of ``Yaml::parse()`` (xabbuh)
6065
- `36f2e1f <https://github.com/symfony/symfony-docs/commit/36f2e1f74b2d166b333cb07029b1fe6e929c2370>`_ #4757 [Components][ClassLoader] don't show deprecated usage of ``Yaml::parse()`` (xabbuh)
6166
- `d8e8d75 <https://github.com/symfony/symfony-docs/commit/d8e8d75961ea0a77c74634a56b6d3237d00ca8a4>`_ #4756 [Components][Config] don't show deprecated usage of ``Yaml::parse()`` (xabbuh)
6267
- `b143754 <https://github.com/symfony/symfony-docs/commit/b143754b22d1086ad58712147075bf1909836a55>`_ #4744 [Book][Security] Update code example to fit description (xelaris)
@@ -104,6 +109,7 @@ Minor Documentation Changes
104109
- `65b0822 <https://github.com/symfony/symfony-docs/commit/65b08224f3909fb97ab3e26483626c6663e26f4f>`_ #4798 Add version added note for the debug:event-dispatcher command (adamelso)
105110
- `bcf1508 <https://github.com/symfony/symfony-docs/commit/bcf150860c81459f3accce4dca3e57eafb213e4d>`_ #4785 [Book][Security] add back old anchors (xabbuh)
106111
- `4143076 <https://github.com/symfony/symfony-docs/commit/4143076e6b2f760b2df03dda6d5933fc54618b68>`_ #4872 [BestPractices] fix merge after removing @Security in 2.3 (xabbuh)
112+
- `dc25c65 <https://github.com/symfony/symfony-docs/commit/dc25c65d445185b5328febe0248e16a3d88d5e0a>`_ #4769 [2.7] Removed 2.5 versionadded as its deprecated (WouterJ)
107113
- `48835de <https://github.com/symfony/symfony-docs/commit/48835de6e61f7f72c7000423b23ec9379ab175f7>`_ #4767 [2.6] Removed 2.4 versionadded as version is deprecated (WouterJ)
108114
- `240a981 <https://github.com/symfony/symfony-docs/commit/240a9815f41c9c1f96d8757b33147e32e5e1b029>`_ #4764 [Reference][Forms] move cautions to make them visible (xabbuh)
109115
- `cf3d38a <https://github.com/symfony/symfony-docs/commit/cf3d38ad333f09fb324ed610c4f5452f4fda213b>`_ #4731 [Book][Testing] bump required PHPUnit version (xabbuh)

Diff for: components/class_loader/psr4_class_loader.rst

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
The PSR-4 Class Loader
55
======================
66

7-
.. versionadded:: 2.5
8-
The :class:`Symfony\\Component\\ClassLoader\\Psr4ClassLoader` was
9-
introduced in Symfony 2.5.
10-
117
Libraries that follow the `PSR-4`_ standard can be loaded with the ``Psr4ClassLoader``.
128

139
.. note::

Diff for: components/console/changing_default_command.rst

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
Changing the Default Command
55
============================
66

7-
.. versionadded:: 2.5
8-
The :method:`Symfony\\Component\\Console\\Application::setDefaultCommand`
9-
method was introduced in Symfony 2.5.
10-
117
The Console component will always run the ``ListCommand`` when no command name is
128
passed. In order to change the default command you just need to pass the command
139
name to the ``setDefaultCommand`` method::

Diff for: components/console/helpers/progressbar.rst

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
Progress Bar
55
============
66

7-
.. versionadded:: 2.5
8-
The Progress Bar feature was introduced in Symfony 2.5 as a replacement for
9-
the :doc:`Progress Helper </components/console/helpers/progresshelper>`.
10-
117
When executing longer-running commands, it may be helpful to show progress
128
information, which updates as your command runs:
139

Diff for: components/console/helpers/questionhelper.rst

+18-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
Question Helper
55
===============
66

7-
.. versionadded:: 2.5
8-
The Question Helper was introduced in Symfony 2.5.
9-
107
The :class:`Symfony\\Component\\Console\\Helper\\QuestionHelper` provides
118
functions to ask the user for more information. It is included in the default
129
helper set, which you can get by calling
@@ -44,6 +41,24 @@ The second argument to
4441
is the default value to return if the user doesn't enter any input. Any other
4542
input will ask the same question again.
4643

44+
.. tip::
45+
46+
You can customize the regex used to check if the answer means "yes" in the
47+
third argument of the constructor. For instance, to allow anything that
48+
starts with either ``y`` or ``j``, you would set it to::
49+
50+
$question = new ConfirmationQuestion(
51+
'Continue with this action?',
52+
false,
53+
'/^(y|j)/i'
54+
);
55+
56+
The regex defaults to ``/^y/i``.
57+
58+
.. versionadded:: 2.7
59+
The regex argument was introduced in Symfony 2.7. Before, only answers
60+
starting with ``y`` were considered as "yes".
61+
4762
Asking the User for Information
4863
-------------------------------
4964

0 commit comments

Comments
 (0)