8000 minor #16767 [Semaphore] Add documentation about semaphore configurat… · symfony/symfony-docs@6001424 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6001424

Browse files
committed
minor #16767 [Semaphore] Add documentation about semaphore configuration (jderusse)
This PR was merged into the 6.1 branch. Discussion ---------- [Semaphore] Add documentation about semaphore configuration fix #16707 Deeply inspired from lock's configuration Commits ------- 3c597d9 Add documentation about semaphore configuration
2 parents 235b302 + 3c597d9 commit 6001424

File tree

1 file changed

+84
-7
lines changed

1 file changed

+84
-7
lines changed

reference/configuration/framework.rst

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,14 @@ can also :ref:`disable CSRF protection on individual forms <form-csrf-customizat
560560
.. configuration-block::
561561

562562
.. code-block:: yaml
563-
563+
564564
# config/packages/framework.yaml
565565
framework:
566566
# ...
567567
csrf_protection: true
568-
568+
569569
.. code-block:: xml
570-
570+
571571
<!-- config/packages/framework.xml -->
572572
<?xml version="1.0" encoding="UTF-8" ?>
573573
<container xmlns="http://symfony.com/schema/dic/services"
@@ -581,9 +581,9 @@ can also :ref:`disable CSRF protection on individual forms <form-csrf-customizat
581581
<framework:csrf-protection enabled="true"/>
582582
</framework:config>
583583
</container>
584-
584+
585585
.. code-block:: php
586-
586+
587587
// config/packages/framework.php
588588
use Symfony\Config\FrameworkConfig;
589589
return static function (FrameworkConfig $framework) {
@@ -3031,7 +3031,8 @@ resources
30313031

30323032
**type**: ``array``
30333033

3034-
A list of lock stores to be created by the framework extension.
3034+
A map of lock stores to be created by the framework extension, with
3035+
the name as key and DSN as value:
30353036

30363037
.. configuration-block::
30373038

@@ -3054,7 +3055,7 @@ A list of lock stores to be created by the framework extension.
30543055
30553056
<framework:config>
30563057
<framework:lock>
3057-
<framework:resource>%env(LOCK_DSN)%</framework:resource>
3058+
<framework:resource name="default">%env(LOCK_DSN)%</framework:resource>
30583059
</framework:lock>
30593060
</framework:config>
30603061
</container>
@@ -3082,6 +3083,82 @@ name
30823083

30833084
Name of the lock you want to create.
30843085

3086+
semaphore
3087+
~~~~~~~~~
3088+
3089+
.. versionadded:: 6.1
3090+
3091+
The ``semaphore`` option was introduced in Symfony 6.1.
3092+
3093+
**type**: ``string`` | ``array``
3094+
3095+
The default semaphore adapter. Store's DSN are also allowed.
3096+
3097+
.. _reference-semaphore-enabled:
3098+
3099+
enabled
3100+
.......
3101+
3102+
**type**: ``boolean`` **default**: ``true``
3103+
3104+
Whether to enable the support for semaphore or not. This setting is
3105+
automatically set to ``true`` when one of the child settings is configured.
3106+
3107+
.. _reference-semaphore-resources:
3108+
3109+
resources
3110+
.........
3111+
3112+
**type**: ``array``
3113+
3114+
A map of semaphore stores to be created by the framework extension, with
3115+
the name as key and DSN as value:
3116+
3117+
.. configuration-block::
3118+
3119+
.. code-block:: yaml
3120+
3121+
# config/packages/semaphore.yaml
3122+
framework:
3123+
semaphore: '%env(SEMAPHORE_DSN)%'
3124+
3125+
.. code-block:: xml
3126+
3127+
<!-- config/packages/semaphore.xml -->
3128+
<?xml version="1.0" encoding="UTF-8" ?>
3129+
<container xmlns="http://symfony.com/schema/dic/services"
3130+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3131+
xmlns:framework="http://symfony.com/schema/dic/symfony"
3132+
xsi:schemaLocation="http://symfony.com/schema/dic/services
3133+
https://symfony.com/schema/dic/services/services-1.0.xsd
3134+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
3135+
3136+
<framework:config>
3137+
<framework:semaphore>
3138+
<framework:resource name="default">%env(SEMAPHORE_DSN)%</framework:resource>
3139+
</framework:semaphore>
3140+
</framework:config>
3141+
</container>
3142+
3143+
.. code-block:: php
3144+
3145+
// config/packages/semaphore.php
3146+
use Symfony\Config\FrameworkConfig;
3147+
3148+
return static function (FrameworkConfig $framework) {
3149+
$framework->semaphore()
3150+
->resource('default', ['%env(SEMAPHORE_DSN)%']);
3151+
};
3152+
3153+
.. _reference-semaphore-resources-name:
3154+
3155+
name
3156+
""""
3157+
3158+
**type**: ``prototype``
3159+
3160+
Name of the semaphore you want to create.
3161+
30853162
mailer
30863163
~~~~~~
30873164

0 commit comments

Comments
 (0)
0