Skip to content

Commit 1c72f5c

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: Document the session.cache_limiter parameter Update spelling in slash_in_parameter.rst Fix classname for Psr6Cache [Console] Always use lazy commands
2 parents 60f9821 + bfbed3a commit 1c72f5c

File tree

7 files changed

+57
-7
lines changed

7 files changed

+57
-7
lines changed

components/console/changing_default_command.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ name to the ``setDefaultCommand()`` method::
1616

1717
class HelloWorldCommand extends Command
1818
{
19+
protected static $defaultName = 'hello:world';
20+
1921
protected function configure()
2022
{
21-
$this->setName('hello:world')
22-
->setDescription('Outputs \'Hello World\'');
23+
$this->setDescription('Outputs "Hello World"');
2324
}
2425

2526
protected function execute(InputInterface $input, OutputInterface $output)

components/console/console_arguments.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ Have a look at the following command that has three options::
2323

2424
class DemoArgsCommand extends Command
2525
{
26+
protected static $defaultName = 'demo:args';
27+
2628
protected function configure()
2729
{
2830
$this
29-
->setName('demo:args')
3031
->setDescription('Describe args behaviors')
3132
->setDefinition(
3233
new InputDefinition([

components/console/logger.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ You can rely on the logger to use this dependency inside a command::
4444

4545
class MyCommand extends Command
4646
{
47+
protected static $defaultName = 'my:command';
48+
4749
protected function configure()
4850
{
4951
$this
50-
->setName('my:command')
5152
->setDescription(
5253
'Use an external dependency requiring a PSR-3 logger'
5354
)

console/commands_as_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ For example, suppose you want to log something from within your command::
2424

2525
class SunshineCommand extends Command
2626
{
27+
protected static $defaultName = 'app:sunshine';
2728
private $logger;
2829

2930
public function __construct(LoggerInterface $logger)
@@ -37,7 +38,6 @@ For example, suppose you want to log something from within your command::
3738
protected function configure()
3839
{
3940
$this
40-
->setName('app:sunshine')
4141
->setDescription('Good morning!');
4242
}
4343

console/hide_commands.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ In those cases, you can define the command as **hidden** by setting the
1818

1919
class LegacyCommand extends Command
2020
{
21+
protected static $defaultName = 'app:legacy';
22+
2123
protected function configure()
2224
{
2325
$this
24-
->setName('app:legacy')
2526
->setHidden(true)
2627
// ...
2728
;

reference/configuration/framework.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Configuration
189189

190190
* `session`_
191191

192+
* `cache_limiter`_
192193
* `cookie_domain`_
193194
* `cookie_httponly`_
194195
* `cookie_lifetime`_
@@ -1193,6 +1194,50 @@ cookie_path
11931194
This determines the path to set in the session cookie. By default, it will
11941195
use ``/``.
11951196

1197+
cache_limiter
1198+
.............
1199+
1200+
**type**: ``string`` or ``int`` **default**: ``''``
1201+
1202+
If set to ``0``, Symfony won't set any particular header related to the cache
1203+
and it will rely on the cache control method configured in the
1204+
`session.cache-limiter`_ PHP.ini option.
1205+
1206+
Unlike the other session options, ``cache_limiter`` is set as a regular
1207+
:doc:`container parameter </service_container/parameters>`:
1208+
1209+
.. configuration-block::
1210+
1211+
.. code-block:: yaml
1212+
1213+
# app/config/services.yml
1214+
parameters:
1215+
session.storage.options:
1216+
cache_limiter: 0
1217+
1218+
.. code-block:: xml
1219+
1220+
<!-- app/config/services.xml -->
1221+
<?xml version="1.0" encoding="UTF-8" ?>
1222+
<container xmlns="http://symfony.com/schema/dic/services"
1223+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1224+
xsi:schemaLocation="http://symfony.com/schema/dic/services
1225+
https://symfony.com/schema/dic/services/services-1.0.xsd">
1226+
1227+
<parameters>
1228+
<parameter key="session.storage.options" type="collection">
1229+
<parameter key="cache_limiter">0</parameter>
1230+
</parameter>
1231+
</parameters>
1232+
</container>
1233+
1234+
.. code-block:: php
1235+
1236+
// app/config/services.php
1237+
$container->setParameter('session.storage.options', [
1238+
'cache_limiter' => 0,
1239+
]);
1240+
11961241
cookie_domain
11971242
.............
11981243

@@ -2776,3 +2821,4 @@ to know their differences.
27762821
.. _`default_socket_timeout`: https://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
27772822
.. _`PEM formatted`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
27782823
.. _`haveibeenpwned.com`: https://haveibeenpwned.com/
2824+
.. _`session.cache-limiter`: https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter

routing/slash_in_parameter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ That's it! Now, the ``{token}`` parameter can contain the ``/`` character.
8787
use the ``.+`` requirement for the parameters that allow slashes. For example,
8888
if the pattern is ``/share/{token}.{_format}`` and ``{token}`` allows any
8989
character, the ``/share/foo/bar.json`` URL will consider ``foo/bar.json``
90-
as the token and the format will be empty. This can be solved replacing the
90+
as the token and the format will be empty. This can be solved by replacing the
9191
``.+`` requirement by ``[^.]+`` to allow any character except dots.
9292

9393
.. note::

0 commit comments

Comments
 (0)