Skip to content

Commit 0e26110

Browse files
committed
Merge branch '3.2'
* 3.2: (28 commits) [#7613] remove reference to AsseticBundle minor #7613 Twig Extensions Reference minor brush-up (mpdude) Update Title in controller.rst Update scheme.rst Update requirements.rst [#7845] minor tweaks Update translation_domain.rst.inc Update page_creation.rst to correct hidden colon Update forms.rst Fixed the form types of the buttons in the Form reference [#7832] use bin/console for Symfony 3.x Minor reword Update deployment.rst KernelTestCase::createKernel() is static, $this->createKernel() -> static::createKernel() Better explain how to enable the validation component and its annotations Fix the link to ConEmu (it is now hosted on GitHub) Add annotation examples to match a route based on the host Minor reword to improve readability Update service_container.rst Minor reword and reformatting ...
2 parents ef36cc7 + 107f2e6 commit 0e26110

21 files changed

+409
-46
lines changed

components/cache/cache_pools.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
single: PDO Cache, Doctrine DBAL Cache
1010
single: Redis Cache
1111

12+
.. _component-cache-cache-pools:
13+
1214
Cache Pools and Supported Adapters
1315
==================================
1416

components/phpunit_bridge.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ If you have this kind of time-related tests::
208208

209209
You used the :doc:`Symfony Stopwatch Component </components/stopwatch>` to
210210
calculate the duration time of your process, here 10 seconds. However, depending
211-
on the load of the server your the processes running on your local machine, the
211+
on the load of the server or the processes running on your local machine, the
212212
``$duration`` could for example be `10.000023s` instead of `10s`.
213213

214214
This kind of tests are called transient tests: they are failing randomly
@@ -390,7 +390,7 @@ Modified PHPUnit script
390390
-----------------------
391391

392392
.. versionadded:: 3.2
393-
The modified PHPUnit script script was introduced in the 3.2 version of
393+
This modified PHPUnit script was introduced in the 3.2 version of
394394
this component.
395395

396396
This bridge provides a modified version of PHPUnit that you can call by using
@@ -423,8 +423,8 @@ If you have installed the bridge through Composer, you can run it by calling e.g
423423

424424
.. tip::
425425

426-
Set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml`` if you need
427-
``prophecy`` but not ``symfony/yaml``.
426+
If you still need to use ``prophecy`` (but not ``symfony/yaml``),
427+
then set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml``.
428428

429429
.. _PHPUnit: https://phpunit.de
430430
.. _`PHPUnit event listener`: https://phpunit.de/manual/current/en/extending-phpunit.html#extending-phpunit.PHPUnit_Framework_TestListener

console.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ you can extend your test from
273273
{
274274
public function testExecute()
275275
{
276-
$kernel = $this->createKernel();
276+
$kernel = static::createKernel();
277277
$kernel->boot();
278278

279279
$application = new Application($kernel);

contributing/code/tests.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ what's going on and if the tests are broken because of the new code.
5555
to see colored test results.
5656

5757
.. _Cmder: http://cmder.net/
58-
.. _ConEmu: https://code.google.com/p/conemu-maximus5/
58+
.. _ConEmu: https://conemu.github.io/
5959
.. _ANSICON: https://github.com/adoxa/ansicon/releases
6060
.. _Mintty: https://mintty.github.io/

controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ The Symfony templating system and Twig are explained more in the
244244

245245
.. _controller-accessing-services:
246246

247-
Accessing other Services
247+
Accessing Other Services
248248
~~~~~~~~~~~~~~~~~~~~~~~~
249249

250250
Symfony comes packed with a lot of useful objects, called *services*. These

deployment.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ specifically tailored to the requirements of Symfony.
8080
`Capistrano`_ with `Symfony plugin`_
8181
`Capistrano`_ is a remote server automation and deployment tool written in Ruby.
8282
`Symfony plugin`_ is a plugin to ease Symfony related tasks, inspired by `Capifony`_
83-
(which works only with Capistrano 2 )
83+
(which works only with Capistrano 2).
8484

8585
`sf2debpkg`_
8686
Helps you build a native Debian package for your Symfony project.
@@ -182,12 +182,12 @@ setup:
182182
* Pushing assets to a CDN
183183
* ...
184184

185-
Application Lifecycle: Continuous Integration, QA, etc
186-
------------------------------------------------------
185+
Application Lifecycle: Continuous Integration, QA, etc.
186+
-------------------------------------------------------
187187

188188
While this entry covers the technical details of deploying, the full lifecycle
189-
of taking code from development up to production may have a lot more steps
190-
(think deploying to staging, QA (Quality Assurance), running tests, etc).
189+
of taking code from development up to production may have more steps:
190+
deploying to staging, QA (Quality Assurance), running tests, etc.
191191

192192
The use of staging, testing, QA, continuous integration, database migrations
193193
and the capability to roll back in case of failure are all strongly advised. There

forms.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ to do with Symfony or any other library. It's quite simply a normal PHP object
6161
that directly solves a problem inside *your* application (i.e. the need to
6262
represent a task in your application). Of course, by the end of this article,
6363
you'll be able to submit data to a ``Task`` instance (via an HTML form), validate
64-
its data, and persist it to the database.
64+
its data and persist it to the database.
6565

6666
.. index::
6767
single: Forms; Create a form in a controller
@@ -114,7 +114,7 @@ from inside a controller::
114114

115115
Creating a form requires relatively little code because Symfony form objects
116116
are built with a "form builder". The form builder's purpose is to allow you
117-
to write simple form "recipes", and have it do all the heavy-lifting of actually
117+
to write simple form "recipes" and have it do all the heavy-lifting of actually
118118
building the form.
119119

120120
In this example, you've added two fields to your form - ``task`` and ``dueDate`` -
@@ -259,7 +259,7 @@ your controller::
259259
is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the
260260
view (like validation errors).
261261

262-
This controller follows a common pattern for handling forms, and has three
262+
This controller follows a common pattern for handling forms and has three
263263
possible paths:
264264

265265
#. When initially loading the page in a browser, the form is created and

introduction/from_flat_php_to_symfony2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ on the requested URI::
370370
echo '<html><body><h1>Page Not Found</h1></body></html>';
371371
}
372372

373-
For organization, both controllers (formerly ``index.php`` and ``show.php``)
373+
For organization, both controllers (formerly ``/index.php`` and ``/index.php/show``)
374374
are now PHP functions and each has been moved into a separate file named ``controllers.php``::
375375

376376
// controllers.php

page_creation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ to creating a page?
8484
in its own section, including how to make *variable* URLs;
8585

8686
#. *Create a controller*: The method below the route - ``numberAction()`` - is called
87-
the *controller*: this is a function where *you* build the page and ultimately
87+
the *controller*. This is a function where *you* build the page and ultimately
8888
return a ``Response`` object. You'll learn more about :doc:`controllers </controller>`
8989
in their own section, including how to return JSON responses.
9090

reference/configuration/framework.rst

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ Configuration
109109
* `log`_
110110
* `throw`_
111111
* :ref:`cache <reference-cache>`
112+
* :ref:`app <reference-cache-app>`
113+
* `system`_
114+
* `directory`_
115+
* `default_doctrine_provider`_
116+
* `default_psr6_provider`_
117+
* `default_redis_provider`_
118+
* `pools`_
119+
* :ref:`name <reference-cache-pools-name>`
120+
* `adapter`_
121+
* `public`_
122+
* `default_lifetime`_
123+
* `provider`_
124+
* `clearer`_
112125
* `prefix_seed`_
113126

114127
secret
@@ -699,6 +712,8 @@ installation.
699712
You can see an example of the usage of this in
700713
:doc:`/doctrine/pdo_session_storage`.
701714

715+
.. _name:
716+
702717
name
703718
....
704719

@@ -1599,6 +1614,129 @@ Throw PHP errors as ``\ErrorException`` instances. The parameter
15991614
cache
16001615
~~~~~
16011616

1617+
.. _reference-cache-app:
1618+
1619+
app
1620+
...
1621+
1622+
**type**: ``string`` **default**: ``cache.adapter.filesystem``
1623+
1624+
The cache adapter used by the ``cache.app`` service. The FrameworkBundle
1625+
ships with multiple adapters: ``apcu``, ``doctrine``, ``system``, ``filesystem``,
1626+
``psr6`` and ``redis``.
1627+
1628+
.. tip::
1629+
1630+
It might be tough to understand at the beginning, so to avoid confusion remember that all pools perform the
1631+
same actions but on different medium given the adapter they are based on. Internally, a pool wraps the definition
1632+
of an adapter.
1633+
1634+
system
1635+
......
1636+
1637+
**type**: ``string`` **default**: ``cache.adapter.system``
1638+
1639+
The cache adapter used by the ``cache.system`` service.
1640+
1641+
directory
1642+
.........
1643+
1644+
**type**: ``string`` **default**: ``%kernel.cache_dir%/pools``
1645+
1646+
The path to the cache directory used by services inheriting from the
1647+
``cache.adapter.filesystem`` adapter (including ``cache.app``).
1648+
1649+
default_doctrine_provider
1650+
.........................
1651+
1652+
**type**: ``string``
1653+
1654+
The service name to use as your default Doctrine provider. The provider is
1655+
available as the ``cache.doctrine`` service.
1656+
1657+
default_psr6_provider
1658+
.....................
1659+
1660+
**type**: ``string``
1661+
1662+
The service name to use as your default PSR-6 provider. It is available as
1663+
the ``cache.psr6`` service.
1664+
1665+
default_redis_provider
1666+
......................
1667+
1668+
**type**: ``string`` **default**: ``redis://localhost``
1669+
1670+
The DSN to use by the Redis provider. The provider is available as the ``cache.redis``
1671+
service.
1672+
1673+
pools
1674+
.....
1675+
1676+
**type**: ``array``
1677+
1678+
A list of cache pools to be created by the framework extension.
1679+
1680+
.. seealso::
1681+
1682+
For more information about how pools works, see :ref:`cache pools <component-cache-cache-pools>`.
1683+
1684+
.. _reference-cache-pools-name:
1685+
1686+
name
1687+
""""
1688+
1689+
**type**: ``prototype``
1690+
1691+
Name of the pool you want to create.
1692+
1693+
.. note::
1694+
1695+
Your pool name must differ from ``cache.app`` or ``cache.system``.
1696+
1697+
adapter
1698+
"""""""
1699+
1700+
**type**: ``string`` **default**: ``cache.app``
1701+
1702+
The name of the adapter to use. You could also use your own implementation.
1703+
1704+
.. note::
1705+
1706+
Your service MUST implement the :class:`Psr\\Cache\\CacheItemPoolInterface` interface.
1707+
1708+
public
1709+
""""""
1710+
1711+
**type**: ``boolean`` **default**: ``false``
1712+
1713+
Whether your service should be public or not.
1714+
1715+
default_lifetime
1716+
""""""""""""""""
1717+
1718+
**type**: ``integer``
1719+
1720+
Default lifetime of your cache items in seconds.
1721+
1722+
provider
1723+
""""""""
1724+
1725+
**type**: ``string``
1726+
1727+
The service name to use as provider when the specified adapter needs one.
1728+
1729+
clearer
1730+
"""""""
1731+
1732+
**type**: ``string``
1733+
1734+
The cache clearer used to clear your PSR-6 cache.
1735+
1736+
.. seealso::
1737+
1738+
For more information, see :class:`Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer`.
1739+
16021740
prefix_seed
16031741
...........
16041742

@@ -1761,6 +1899,23 @@ Full Default Configuration
17611899
log: false
17621900
throw: '%kernel.debug%'
17631901
1902+
# cache configuration
1903+
cache:
1904+
app: cache.app
1905+
system: cache.system
1906+
directory: '%kernel.cache_dir%/pools'
1907+
default_doctrine_provider: ~
1908+
default_psr6_provider: ~
1909+
default_redis_provider: 'redis://localhost'
1910+
pools:
1911+
# Prototype
1912+
name:
1913+
adapter: cache.app
1914+
public: false
1915+
default_lifetime: ~
1916+
provider: ~
1917+
clearer: ~
1918+
17641919
.. _`HTTP Host header attacks`: http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
17651920
.. _`Security Advisory Blog post`: https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning
17661921
.. _`Doctrine Cache`: http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/caching.html

reference/configuration/security.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,13 @@ multiple firewalls, the "context" could actually be shared:
657657
),
658658
));
659659
660+
.. note::
661+
662+
The firewall context key is stored in session, so every firewall using it
663+
must set its ``stateless`` option to ``false``. Otherwise, the context is
664+
ignored and you won't be able to authenticate on multiple firewalls at the
665+
same time.
666+
660667
HTTP-Digest Authentication
661668
--------------------------
662669

reference/forms/types/button.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ The ``BaseType`` class is the parent class for both the ``button`` type
2828
and the :doc:`FormType </reference/forms/types/form>`, but it is not part
2929
of the form type tree (i.e. it cannot be used as a form type on its own).
3030

31-
.. include:: /reference/forms/types/options/button_attr.rst.inc
31+
attr
32+
~~~~
33+
34+
**type**: ``array`` **default**: ``array()``
35+
36+
If you want to add extra attributes to the HTML representation of the button,
37+
you can use ``attr`` option. It's an associative array with HTML attribute
38+
as a key. This can be useful when you need to set a custom class for the button::
39+
40+
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
41+
// ...
42+
43+
$builder->add('save', ButtonType::class, array(
44+
'attr' => array('class' => 'save'),
45+
));
3246

3347
.. include:: /reference/forms/types/options/button_disabled.rst.inc
3448

reference/forms/types/options/button_attr.rst.inc

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
translation_domain
22
~~~~~~~~~~~~~~~~~~
33

4-
**type**: ``string`` **default**: ``messages``
4+
**type**: ``string``, ``null`` or ``false`` **default**: ``null``
55

6-
This is the translation domain that will be used for any labels or options
7-
that are rendered for this field.
6+
This is the translation domain that will be used for any label or option
7+
that is rendered for this field. Use ``null`` to reuse the translation domain
8+
of the parent form (or the default domain of the translator for the root
9+
form). Use ``false`` to disable translations.

0 commit comments

Comments
 (0)