Skip to content

Commit f65a9a7

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

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
@@ -190,6 +190,7 @@ Configuration
190190

191191
* `session`_
192192

193+
* `cache_limiter`_
193194
* `cookie_domain`_
194195
* `cookie_httponly`_
195196
* `cookie_lifetime`_
@@ -1208,6 +1209,50 @@ cookie_path
12081209
This determines the path to set in the session cookie. By default, it will
12091210
use ``/``.
12101211

1212+
cache_limiter
1213+
.............
1214+
1215+
**type**: ``string`` or ``int`` **default**: ``''``
1216+
1217+
If set to ``0``, Symfony won't set any particular header related to the cache
1218+
and it will rely on the cache control method configured in the
1219+
`session.cache-limiter`_ PHP.ini option.
1220+
1221+
Unlike the other session options, ``cache_limiter`` is set as a regular
1222+
:doc:`container parameter </service_container/parameters>`:
1223+
1224+
.. configuration-block::
1225+
1226+
.. code-block:: yaml
1227+
1228+
# app/config/services.yml
1229+
parameters:
1230+
session.storage.options:
1231+
cache_limiter: 0
1232+
1233+
.. code-block:: xml
1234+
1235+
<!-- app/config/services.xml -->
1236+
<?xml version="1.0" encoding="UTF-8" ?>
1237+
<container xmlns="http://symfony.com/schema/dic/services"
1238+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1239+
xsi:schemaLocation="http://symfony.com/schema/dic/services
1240+
https://symfony.com/schema/dic/services/services-1.0.xsd">
1241+
1242+
<parameters>
1243+
<parameter key="session.storage.options" type="collection">
1244+
<parameter key="cache_limiter">0</parameter>
1245+
</parameter>
1246+
</parameters>
1247+
</container>
1248+
1249+
.. code-block:: php
1250+
1251+
// app/config/services.php
1252+
$container->setParameter('session.storage.options', [
1253+
'cache_limiter' => 0,
1254+
]);
1255+
12111256
cookie_domain
12121257
.............
12131258

@@ -2791,4 +2836,5 @@ to know their differences.
27912836
.. _`default_socket_timeout`: https://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
27922837
.. _`PEM formatted`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
27932838
.. _`haveibeenpwned.com`: https://haveibeenpwned.com/
2839+
.. _`session.cache-limiter`: https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter
27942840
.. _`Microsoft NTLM authentication protocol`: https://docs.microsoft.com/en-us/windows/desktop/secauthn/microsoft-ntlm

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)