@@ -144,6 +144,12 @@ Configuration
144144* `http_method_override `_
145145* `ide `_
146146* :ref: `lock <reference-lock >`
147+
148+ * :ref: `enabled <reference-lock-enabled >`
149+ * :ref: `resources <reference-lock-resources >`
150+
151+ * :ref: `name <reference-lock-resources-name >`
152+
147153* `php_errors `_
148154
149155 * `log `_
@@ -220,7 +226,7 @@ Configuration
220226 * `engines `_
221227 * :ref: `form <reference-templating-form >`
222228
223- * `resources `_
229+ * :ref: `resources < reference-templating-form-resources >`
224230
225231 * `loaders `_
226232
@@ -1987,6 +1993,8 @@ templating
19871993form
19881994....
19891995
1996+ .. _reference-templating-form-resources :
1997+
19901998resources
19911999"""""""""
19922000
@@ -2777,11 +2785,131 @@ example, when warming caches offline).
27772785lock
27782786~~~~
27792787
2780- **type **: ``string ``
2788+ **type **: ``string `` | `` array ``
27812789
27822790The default lock adapter. If not defined, the value is set to ``semaphore `` when
27832791available, or to ``flock `` otherwise. Store's DSN are also allowed.
27842792
2793+ .. _reference-lock-enabled :
2794+
2795+ enabled
2796+ .......
2797+
2798+ **type **: ``boolean `` **default **: ``true ``
2799+
2800+ Whether to enable the support for lock or not. This setting is
2801+ automatically set to ``true `` when one of the child settings is configured.
2802+
2803+ .. _reference-lock-resources :
2804+
2805+ resources
2806+ .........
2807+
2808+ **type **: ``array ``
2809+
2810+ A list of lock stores to be created by the framework extension.
2811+
2812+ .. configuration-block ::
2813+
2814+ .. code-block :: yaml
2815+
2816+ # app/config/config.yml
2817+ framework :
2818+ # these are all the supported lock stores
2819+ lock : ~
2820+ lock : ' flock'
2821+ lock : ' semaphore'
2822+ lock : ' memcached://m1.docker'
2823+ lock : ['memcached://m1.docker', 'memcached://m2.docker']
2824+ lock : ' redis://r1.docker'
2825+ lock : ['redis://r1.docker', 'redis://r2.docker']
2826+ lock : ' %env(MEMCACHED_OR_REDIS_URL)%'
2827+
2828+ # named locks
2829+ lock :
2830+ invoice : ['redis://r1.docker', 'redis://r2.docker']
2831+ report : ' semaphore'
2832+
2833+ .. code-block :: xml
2834+
2835+ <!-- app/config/config.xml -->
2836+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2837+ <container xmlns =" http://symfony.com/schema/dic/services"
2838+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2839+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
2840+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
2841+ https://symfony.com/schema/dic/services/services-1.0.xsd
2842+ http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
2843+
2844+ <framework : config >
2845+ <framework : lock >
2846+ <!-- these are all the supported lock stores -->
2847+ <framework : resource >flock</framework : resource >
2848+
2849+ <framework : resource >semaphore</framework : resource >
2850+
2851+ <framework : resource >memcached://m1.docker</framework : resource >
2852+
2853+ <framework : resource >memcached://m1.docker</framework : resource >
2854+ <framework : resource >memcached://m2.docker</framework : resource >
2855+
2856+ <framework : resource >redis://r1.docker</framework : resource >
2857+
2858+ <framework : resource >redis://r1.docker</framework : resource >
2859+ <framework : resource >redis://r2.docker</framework : resource >
2860+
2861+ <framework : resource >%env(REDIS_URL)%</framework : resource >
2862+
2863+ <!-- named locks -->
2864+ <framework : resource name =" invoice" >redis://r1.docker</framework : resource >
2865+ <framework : resource name =" invoice" >redis://r2.docker</framework : resource >
2866+ <framework : resource name =" report" >semaphore</framework : resource >
2867+ </framework : lock >
2868+ </framework : config >
2869+ </container >
2870+
2871+ .. code-block :: php
2872+
2873+ // app/config/config.php
2874+ $container->loadFromExtension('framework', [
2875+ // these are all the supported lock stores
2876+ 'lock' => null,
2877+ 'lock' => 'flock',
2878+ 'lock' => 'semaphore',
2879+ 'lock' => 'memcached://m1.docker',
2880+ 'lock' => ['memcached://m1.docker', 'memcached://m2.docker'],
2881+ 'lock' => 'redis://r1.docker',
2882+ 'lock' => ['redis://r1.docker', 'redis://r2.docker'],
2883+ 'lock' => '%env(MEMCACHED_OR_REDIS_URL)%',
2884+
2885+ // named locks
2886+ 'lock' => [
2887+ 'invoice' => ['redis://r1.docker', 'redis://r2.docker'],
2888+ 'report' => 'semaphore',
2889+ ],
2890+ ]);
2891+
2892+ .. _reference-lock-resources-name :
2893+
2894+ name
2895+ """"
2896+
2897+ **type **: ``prototype ``
2898+
2899+ Name of the lock you want to create.
2900+
2901+ .. tip ::
2902+
2903+ If you want to use the `RetryTillSaveStore ` for :ref: `non-blocking locks <lock-blocking-locks >`,
2904+ you can do it by :doc: `decorating the store </service_container/service_decoration >` service:
2905+
2906+ .. code-block :: yaml
2907+
2908+ lock.invoice.retry_till_save.store :
2909+ class : Symfony\Component\Lock\Store\RetryTillSaveStore
2910+ decorates : lock.invoice.store
2911+ arguments : ['@lock.invoice.retry.till.save.store.inner', 100, 50]
2912+
27852913 workflows
27862914~~~~~~~~~
27872915
0 commit comments