Skip to content

Commit bfbed3a

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

File tree

8 files changed

+59
-9
lines changed

8 files changed

+59
-9
lines changed

components/cache/psr6_psr16_adapters.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ the class instead. No problem! The Cache component provides the
7474
this use-case::
7575

7676
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
77-
use Symfony\Component\Cache\Simple\Psr16Cache;
77+
use Symfony\Component\Cache\Simple\Psr6Cache;
7878

7979
// the PSR-6 cache object that you want to use
8080
$psr6Cache = new FilesystemAdapter();
8181

8282
// a PSR-16 cache that uses your cache internally!
83-
$psr16Cache = new Psr16Cache($psr6Cache);
83+
$psr16Cache = new Psr6Cache($psr6Cache);
8484

8585
// now use this wherever you want
8686
$githubApiClient = new GitHubApiClient($psr16Cache);

components/console/changing_default_command.rst

+3-2
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

+2-1
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

+2-1
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

+1-1
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

+2-1
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

+46
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Configuration
138138

139139
* `session`_
140140

141+
* `cache_limiter`_
141142
* `cookie_domain`_
142143
* `cookie_httponly`_
143144
* `cookie_lifetime`_
@@ -832,6 +833,50 @@ cookie_path
832833
This determines the path to set in the session cookie. By default, it will
833834
use ``/``.
834835

836+
cache_limiter
837+
.............
838+
839+
**type**: ``string`` or ``int`` **default**: ``''``
840+
841+
If set to ``0``, Symfony won't set any particular header related to the cache
842+
and it will rely on the cache control method configured in the
843+
`session.cache-limiter`_ PHP.ini option.
844+
845+
Unlike the other session options, ``cache_limiter`` is set as a regular
846+
:doc:`container parameter </service_container/parameters>`:
847+
848+
.. configuration-block::
849+
850+
.. code-block:: yaml
851+
852+
# app/config/services.yml
853+
parameters:
854+
session.storage.options:
855+
cache_limiter: 0
856+
857+
.. code-block:: xml
858+
859+
<!-- app/config/services.xml -->
860+
<?xml version="1.0" encoding="UTF-8" ?>
861+
<container xmlns="http://symfony.com/schema/dic/services"
862+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
863+
xsi:schemaLocation="http://symfony.com/schema/dic/services
864+
https://symfony.com/schema/dic/services/services-1.0.xsd">
865+
866+
<parameters>
867+
<parameter key="session.storage.options" type="collection">
868+
<parameter key="cache_limiter">0</parameter>
869+
</parameter>
870+
</parameters>
871+
</container>
872+
873+
.. code-block:: php
874+
875+
// app/config/services.php
876+
$container->setParameter('session.storage.options', [
877+
'cache_limiter' => 0,
878+
]);
879+
835880
cookie_domain
836881
.............
837882

@@ -2333,3 +2378,4 @@ to know their differences.
23332378
.. _`webpack-manifest-plugin`: https://www.npmjs.com/package/webpack-manifest-plugin
23342379
.. _`error_reporting PHP option`: https://secure.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
23352380
.. _`CSRF security attacks`: https://en.wikipedia.org/wiki/Cross-site_request_forgery
2381+
.. _`session.cache-limiter`: https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter

routing/slash_in_parameter.rst

+1-1
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)