8000 Merge branch '3.2' · symfony/symfony-docs@c45a7f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c45a7f2

Browse files
committed
Merge branch '3.2'
* 3.2: (22 commits) Rename "console tasks" to "console commands" [Workflow] Add tip for workflow configuration default values Reflect private to hidden renaming in the file name Reflect renaming from private to hidden Added an article about private console commands Updated the explanation about framework.ide [#7214] fix option's default value strict default option for choice validation Reworded the user checker aliases explanation Remove duplicate use operator [Fix][httpKernel] Wrong links [Fix][Console] Missing autoloading by Composer Revert "Fixed wrong inheritance information" [#7318] Removing unnecessary word Minor fixes Explain what is the Symfony Core team Added the references to security vulnerabilities discovered in 2016 Improve configuration example text indents update year in license template describe should have an 's' on the end ...
2 parents e41f358 + 2ad5fb9 commit c45a7f2

File tree

23 files changed

+116
-65
lines changed

23 files changed

+116
-65
lines changed

components/console/usage.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ built-in options as well as a couple of built-in commands for the Console compon
1616
<?php
1717
// application.php
1818

19+
require __DIR__.'/vendor/autoload.php';
20+
1921
use Symfony\Component\Console\Application;
2022

2123
$application = new Application();

components/form.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,25 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
194194
$vendorTwigBridgeDir.'/Resources/views/Form',
195195
)));
196196
$formEngine = new TwigRendererEngine(array($defaultFormTheme));
197-
$formEngine->setEnvironment($twig);
197+
$twig->addRuntimeLoader(new \Twig_FactoryRuntimeLoader(array(
198+
TwigRenderer::class => function () use ($formEngine, $csrfManager) {
199+
return new TwigRenderer($formEngine, $csrfManager);
200+
},
201+
)));
198202

199203
// ... (see the previous CSRF Protection section for more information)
200204

201205
// add the FormExtension to Twig
202-
$twig->addExtension(
203-
new FormExtension(new TwigRenderer($formEngine, $csrfManager))
204-
);
206+
$twig->addExtension(new FormExtension());
205207

206208
// create your form factory as normal
207209
$formFactory = Forms::createFormFactoryBuilder()
208210
// ...
209211
->getFormFactory();
210212

213+
.. versionadded:: 1.30
214+
The ``Twig_FactoryRuntimeLoader`` was introduced in Twig 1.30.
215+
211216
The exact details of your `Twig Configuration`_ will vary, but the goal is
212217
always to add the :class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`
213218
to Twig, which gives you access to the Twig functions for rendering forms.

components/http_kernel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ For general information on adding listeners to the events below, see
124124

125125
.. caution::
126126

127-
As of 3.1 the :class:`Symfony\\Component\\Httpkernel\\HttpKernel` accepts a
127+
As of 3.1 the :class:`Symfony\\Component\\HttpKernel\\HttpKernel` accepts a
128128
fourth argument, which must be an instance of
129-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolverInterface`.
129+
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolverInterface`.
130130
In 4.0 this argument will become mandatory.
131131

132132
.. seealso::

console/hide_commands.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
How to Hide Console Commands
2+
============================
3+
4+
By default, all console commands are listed when executing the console application
5+
script without arguments or when using the ``list`` command.
6+
7+
However, sometimes commands are not intended to be executed by end-users; for
8+
example, commands for the legacy parts of the application, commands exclusively
9+
executed through scheduled tasks, etc.
10+
11+
In those cases, you can define the command as **hidden** by setting the
12+
``setHidden()`` method to ``true`` in the command configuration::
13+
14+
// src/AppBundle/Command/LegacyCommand.php
15+
namespace AppBundle\Command;
16+
17+
use Symfony\Component\Console\Command\Command;
18+
19+
class LegacyCommand extends Command
20+
{
21+
protected function configure()
22+
{
23+
$this
24+
->setName('app:legacy')
25+
->setHidden(true)
26+
// ...
27+
;
28+
}
29+
}
30+
31+
Hidden commands behave the same as normal commands but they are no longer displayed
32+
in command listings, so end-users are not aware of their existence.

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Next, use this in the command to print the message multiple times::
134134
$output->writeln($text);
135135
}
136136

137-
Now, when you run the task, you can optionally specify a ``--iterations``
137+
Now, when you run the command, you can optionally specify a ``--iterations``
138138
flag:
139139

140140
.. code-block:: terminal

contributing/code/core_team.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
Symfony Core Team
22
=================
33

4-
This document states the rules that govern the Symfony Core group. These rules
4+
The **Symfony Core** team is the group of developers that determine the
5+
direction and evolution of the Symfony project. Their votes rule if the
6+
features and patches proposed by the community are approved or rejected.
7+
8+
All the Symfony Core members are long-time contributors with solid technical
9+
expertise and they have demonstrated a strong commitment to drive the project
10+
forward.
11+
12+
This document states the rules that govern the Symfony Core team. These rules
513
are effective upon publication of this document and all Symfony Core members
614
must adhere to said rules and protocol.
715

contributing/code/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ According to `Wikipedia`_:
1616
The License
1717
-----------
1818

19-
Copyright (c) 2004-2016 Fabien Potencier
19+
Copyright (c) 2004-2017 Fabien Potencier
2020

2121
Permission is hereby granted, free of charge, to any person obtaining a copy
2222
of this software and associated documentation files (the "Software"), to deal

contributing/code/security.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ Security Advisories
103103
This section indexes security vulnerabilities that were fixed in Symfony
104104
releases, starting from Symfony 1.0.0:
105105

106-
* November 23, 2015: `CVE-2015-8125: Potential Remote Timing Attack Vulnerability in Security Remember-Me Service <http://symfony.com/blog/cve-2015-8125-potential-remote-timing-attack-vulnerability-in-security-remember-me-service>`_ (2.3.35, 2.6.12 and 2.7.7)
107-
* November 23, 2015: `CVE-2015-8124: Session Fixation in the "Remember Me" Login Feature <http://symfony.com/blog/cve-2015-8124-session-fixation-in-the-remember-me-login-feature>`_ (2.3.35, 2.6.12 and 2.7.7)
106+
* May 9, 2016: `CVE-2016-2403: Unauthorized access on a misconfigured Ldap server when using an empty password <http://symfony.com/blog/cve-2016-2403-unauthorized-access-on-a-misconfigured-ldap-server-when-using-an-empty-password>`_ (2.8.0-2.8.5, 3.0.0-3.0.5)
107+
* May 9, 2016: `CVE-2016-4423: Large username storage in session <https://symfony.com/blog/cve-2016-4423-large-username-storage-in-session>`_ (2.3.0-2.3.40, 2.7.0-2.7.12, 2.8.0-2.8.5, 3.0.0-3.0.5)
108+
* January 18, 2016: `CVE-2016-1902: SecureRandom's fallback not secure when OpenSSL fails <https://symfony.com/blog/cve-2016-1902-securerandom-s-fallback-not-secure-when-openssl-fails>`_ (2.3.0-2.3.36, 2.6.0-2.6.12, 2.7.0-2.7.8)
109+
* November 23, 2015: `CVE-2015-8125: Potential Remote Timing Attack Vulnerability in Security Remember-Me Service <https://symfony.com/blog/cve-2015-8125-potential-remote-timing-attack-vulnerability-in-security-remember-me-service>`_ (2.3.35, 2.6.12 and 2.7.7)
110+
* November 23, 2015: `CVE-2015-8124: Session Fixation in the "Remember Me" Login Feature <https://symfony.com/blog/cve-2015-8124-session-fixation-in-the-remember-me-login-feature>`_ (2.3.35, 2.6.12 and 2.7.7)
108111
* May 26, 2015: `CVE-2015-4050: ESI unauthorized access <https://symfony.com/blog/cve-2015-4050-esi-unauthorized-access>`_ (Symfony 2.3.29, 2.5.12 and 2.6.8)
109112
* April 1, 2015: `CVE-2015-2309: Unsafe methods in the Request class <https://symfony.com/blog/cve-2015-2309-unsafe-methods-in-the-request-class>`_ (Symfony 2.3.27, 2.5.11 and 2.6.6)
110113
* April 1, 2015: `CVE-2015-2308: Esi Code Injection <https://symfony.com/blog/cve-2015-2308-esi-code-injection>`_ (Symfony 2.3.27, 2.5.11 and 2.6.6)

create_framework/routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Instead of an array for the URL map, the Routing component relies on a
5656

5757
$routes = new RouteCollection();
5858

59-
Let's add a route that describe the ``/hello/SOMETHING`` URL and add another
59+
Let's add a route that describes the ``/hello/SOMETHING`` URL and add another
6060
one for the simple ``/bye`` one::
6161

6262
use Symfony\Component\Routing\Route;

doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ in your application. To do this, run:
518518
your entities) with how it *actually* looks, and executes the SQL statements
519519
needed to *update* the database schema to where it should be. In other
520520
words, if you add a new property with mapping metadata to ``Product``
521-
and run this task, it will execute the "ALTER TABLE" statement needed
521+
and run this command, it will execute the "ALTER TABLE" statement needed
522522
to add that new column to the existing ``product`` table.
523523

524524
An even better way to take advantage of this functionality is via

doctrine/associations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the class for you.
1818
--entity="AppBundle:Category" \
1919
--fields="name:string(255)"
2020
21-
This task generates the ``Category`` entity for you, with an ``id`` field,
21+
This command generates the ``Category`` entity for you, with an ``id`` field,
2222
a ``name`` field and the associated getter and setter functions.
2323

2424
Relationship Mapping Metadata

doctrine/console.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ command:
1616
A list of available commands will print out. You can find out more information
1717
about any of these commands (or any Symfony command) by running the ``help``
1818
command. For example, to get details about the ``doctrine:database:create``
19-
task, run:
19+
command, run:
2020

2121
.. code-block:: terminal
2222
2323
$ php bin/console help doctrine:database:create
2424
25-
Some notable or interesting tasks include:
25+
Some notable or interesting commands include:
2626

2727
* ``doctrine:ensure-production-settings`` - checks to see if the current
2828
environment is configured efficiently for production. This should always

forms.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ the choice is ultimately up to you.
641641

642642
use AppBundle\Entity\Task;
643643
use Symfony\Component\OptionsResolver\OptionsResolver;
644-
use AppBundle\Entity\Task;
645644

646645
// ...
647646
public function configureOptions(OptionsResolver $resolver)

reference/configuration/framework.rst

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -211,25 +211,16 @@ ide
211211

212212
**type**: ``string`` **default**: ``null``
213213

214-
Symfony can turn file paths seen in dumps and exception messages into links
215-
that will open in your preferred text editor or IDE.
214+
Symfony turns file paths seen in variable dumps and exception messages into
215+
links that open those files right inside your browser. If you prefer to open
216+
those files in your favorite IDE or text editor, set this option to any of the
217+
following values: ``phpstorm`` (requires `PhpStormProtocol`_), ``sublime``,
218+
``textmate``, ``macvim`` and ``emacs``.
216219

217-
Since every developer uses a different IDE, the recommended way to enable this
218-
feature is to configure it on a system level. This can be done by setting the
219-
``xdebug.file_link_format`` option in your ``php.ini`` configuration file.
220-
221-
.. tip::
222-
223-
Setting the ``xdebug.file_link_format`` ini option works even if the Xdebug
224-
extension is not enabled.
225-
226-
Alternatively, you can use this ``ide`` configuration key.
227-
228-
In both cases, the expected configuration value is a URL template that contains an
229-
``%f`` where the file path is expected and ``%l`` for the line number. When using
230-
the ``ide`` configuration key, percentages signs (``%``) must be escaped by
231-
doubling them. For example, if you use PHPstorm on the Mac OS platform, you will
232-
do something like:
220+
If you use another editor, the expected configuration value is a URL template
221+
that contains an ``%f`` placeholder where the file path is expected and ``%l``
222+
placeholder for the line number (percentage signs (``%``) must be escaped by
223+
doubling them to prevent Symfony from interpreting them as container parameters).
233224

234225
.. configuration-block::
235226

@@ -259,6 +250,22 @@ do something like:
259250
'ide' => 'phpstorm://open?file=%%f&line=%%l',
260251
));
261252
253+
Since every developer uses a different IDE, the recommended way to enable this
254+
feature is to configure it on a system level. This can be done by setting the
255+
``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The
256+
format to use is the same as for the ``framework.ide`` option, but without the
257+
need to escape the percent signs (``%``) by doubling them.
258+
259+
.. note::
260+
261+
If both ``framework.ide`` and ``xdebug.file_link_format`` are defined,
262+
Symfony uses the value of the ``framework.ide`` option.
263+
264+
.. tip::
265+
266+
Setting the ``xdebug.file_link_format`` ini option works even if the Xdebug
267+
extension is not enabled.
268+
262269
.. tip::
263270

264271
When running your app in a container or in a virtual machine, you can tell
@@ -274,12 +281,6 @@ do something like:
274281
.. versionadded:: 3.2
275282
Guest to host mappings were introduced in Symfony 3.2.
276283

277-
.. tip::
278-
279-
Symfony contains preconfigured URLs for some popular IDEs, you can set them
280-
using the following values: ``phpstorm`` (requires `PhpStormProtocol`_),
281-
``sublime``, ``textmate``, ``macvim`` or ``emacs``.
282-
283284
.. _reference-framework-test:
284285

285286
test

reference/constraints/Choice.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,13 @@ strict
369369

370370
**type**: ``boolean`` **default**: ``false``
371371

372-
If true, the validator will also check the type of the input value. Specifically,
372+
The validator will also check the type of the input value. Specifically,
373373
this value is passed to as the third argument to the PHP :phpfunction:`in_array`
374374
method when checking to see if a value is in the valid choices array.
375375

376+
.. caution::
377+
378+
Setting the strict option of the Choice Constraint to ``false`` has been
379+
deprecated as of Symfony 3.2 and the option will be changed to ``true`` as of 4.0.
380+
376381
.. include:: /reference/constraints/_payload-option.rst.inc

reference/dic_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ kernel.cache_warmer
500500
process
501501

502502
Cache warming occurs whenever you run the ``cache:warmup`` or ``cache:clear``
503-
task (unless you pass ``--no-warmup`` to ``cache:clear``). It is also run
503+
command (unless you pass ``--no-warmup`` to ``cache:clear``). It is also run
504504
when handling the request, if it wasn't done by one of the commands yet.
505505
The purpose is to initialize any cache that will be needed by the application
506506
and prevent the first user from any significant "cache hit" where the cache

security/acl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ First, you need to configure the connection the ACL system is supposed to use:
9191
domain objects. You can use whatever mapper you like for your objects, be it
9292
Doctrine ORM, MongoDB ODM, Propel, raw SQL, etc. The choice is yours.
9393

94-
After the connection is configured, you have to import the database structure.
95-
Fortunately, there is a task for this. Simply run the following command:
94+
After the connection is configured, you have to import the database structure
95+
running the following command:
9696

9797
.. code-block:: terminal
9898

security/custom_provider.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,6 @@ Now you make the user provider available as a service:
211211
dependencies or configuration options or other services. Add these as
212212
arguments in the service definition.
213213

214-
.. note::
215-
216-
Make sure the services file is being imported. See :ref:`service-container-imports-directive`
217-
for details.
218-
219214
Modify ``security.yml``
220215
-----------------------
221216

security/user_checkers.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,3 @@ It's possible to have a different user checker per firewall.
207207
),
208208
),
209209
));
210-
211-
.. note::
212-
213-
Internally the user checkers are aliased per firewall. For ``secured_area``
214-
the alias ``security.user_checker.secured_area`` would point to ``app.user_checker``.

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ Injection Container::
457457
$container = $client->getContainer();
458458

459459
For a list of services available in your application, use the ``debug:container``
460-
console task.
460+
command.
461461

462462
.. tip::
463463

validation/groups.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ the class name or the string ``Default``.
166166
object that's actually the one being validated.
167167

168168
If you have inheritance (e.g. ``User extends BaseUser``) and you validate
169-
with the class name of the subclass (i.e. ``User``), then only constraints
170-
in the ``User`` will be validated. To validate the parent constraints as
171-
  well you need to provide multiple groups (i.e ``User`` and ``BaseUser``) or
172-
   ``Default``.
173-
169+
with the class name of the subclass (i.e. ``User``), then all constraints
170+
in the ``User`` and ``BaseUser`` will be validated. However, if you
171+
validate using the base class (i.e. ``BaseUser``), then only the default
172+
constraints in the ``BaseUser`` class will be validated.
173+
174174
To tell the validator to use a specific group, pass one or more group names
175175
as the third argument to the ``validate()`` method::
176176

workflow/state-machines.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ Below is the configuration for the pull request state machine.
3232
framework:
3333
workflows:
3434
pull_request:
35-
type: 'state_machine'
36-
supports:
35+
type: 'state_machine'
36+
supports:
3737
- AppBundle\Entity\PullRequest
38-
places:
38+
places:
3939
- start
4040
- coding
4141
- travis
4242
- review
4343
- merged
4444
- closed
45-
transitions:
45+
transitions:
4646
submit:
4747
from: start
4848
to: travis

workflow/usage.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ like this:
148148
The marking store type could be "multiple_state" or "single_state".
149149
A single state marking store does not support a model being on multiple places
150150
at the same time.
151+
152+
.. tip::
153+
154+
The ``type`` (default value ``single_state``) and ``arguments`` (default value ``marking``)
155+
attributes of the ``marking_store`` option are optional. If omitted, their default values
156+
will be used.
151157

152158
With this workflow named ``blog_publishing``, you can get help to decide
153159
what actions that are allowed on a blog post. ::

0 commit comments

Comments
 (0)
0