@@ -87,6 +87,12 @@ Configuration
87
87
* `http_method_override `_
88
88
* `ide `_
89
89
* :ref: `lock <reference-lock >`
90
+
91
+ * :ref: `enabled <reference-lock-enabled >`
92
+ * :ref: `resources <reference-lock-resources >`
93
+
94
+ * :ref: `name <reference-lock-resources-name >`
95
+
90
96
* `php_errors `_
91
97
92
98
* `log `_
@@ -164,7 +170,7 @@ Configuration
164
170
* `engines `_
165
171
* :ref: `form <reference-templating-form >`
166
172
167
- * `resources `_
173
+ * :ref: `resources < reference-templating-form-resources >`
168
174
169
175
* `hinclude_default_template `_
170
176
* `loaders `_
@@ -1518,6 +1524,8 @@ is disabled. This can be either a template name or the content itself.
1518
1524
form
1519
1525
....
1520
1526
1527
+ .. _reference-templating-form-resources :
1528
+
1521
1529
resources
1522
1530
"""""""""
1523
1531
@@ -2175,11 +2183,131 @@ example, when warming caches offline).
2175
2183
lock
2176
2184
~~~~
2177
2185
2178
- **type **: ``string ``
2186
+ **type **: ``string `` | `` array ``
2179
2187
2180
2188
The default lock adapter. If not defined, the value is set to ``semaphore `` when
2181
2189
available, or to ``flock `` otherwise. Store's DSN are also allowed.
2182
2190
2191
+ .. _reference-lock-enabled :
2192
+
2193
+ enabled
2194
+ .......
2195
+
2196
+ **type **: ``boolean `` **default **: ``true ``
2197
+
2198
+ Whether to enable the support for lock or not. This setting is
2199
+ automatically set to ``true `` when one of the child settings is configured.
2200
+
2201
+ .. _reference-lock-resources :
2202
+
2203
+ resources
2204
+ .........
2205
+
2206
+ **type **: ``array ``
2207
+
2208
+ A list of lock stores to be created by the framework extension.
2209
+
2210
+ .. configuration-block ::
2211
+
2212
+ .. code-block :: yaml
2213
+
2214
+ # app/config/config.yml
2215
+ framework :
2216
+ # these are all the supported lock stores
2217
+ lock : ~
2218
+ lock : ' flock'
2219
+ lock : ' semaphore'
2220
+ lock : ' memcached://m1.docker'
2221
+ lock : ['memcached://m1.docker', 'memcached://m2.docker']
2222
+ lock : ' redis://r1.docker'
2223
+ lock : ['redis://r1.docker', 'redis://r2.docker']
2224
+ lock : ' %env(MEMCACHED_OR_REDIS_URL)%'
2225
+
2226
+ # named locks
2227
+ lock :
2228
+ invoice : ['redis://r1.docker', 'redis://r2.docker']
2229
+ report : ' semaphore'
2230
+
2231
+ .. code-block :: xml
2232
+
2233
+ <!-- app/config/config.xml -->
2234
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2235
+ <container xmlns =" http://symfony.com/schema/dic/services"
2236
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2237
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
2238
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
2239
+ https://symfony.com/schema/dic/services/services-1.0.xsd
2240
+ http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
2241
+
2242
+ <framework : config >
2243
+ <framework : lock >
2244
+ <!-- these are all the supported lock stores -->
2245
+ <framework : resource >flock</framework : resource >
2246
+
2247
+ <framework : resource >semaphore</framework : resource >
2248
+
2249
+ <framework : resource >memcached://m1.docker</framework : resource >
2250
+
2251
+ <framework : resource >memcached://m1.docker</framework : resource >
2252
+ <framework : resource >memcached://m2.docker</framework : resource >
2253
+
2254
+ <framework : resource >redis://r1.docker</framework : resource >
2255
+
2256
+ <framework : resource >redis://r1.docker</framework : resource >
2257
+ <framework : resource >redis://r2.docker</framework : resource >
2258
+
2259
+ <framework : resource >%env(REDIS_URL)%</framework : resource >
2260
+
2261
+ <!-- named locks -->
2262
+ <framework : resource name =" invoice" >redis://r1.docker</framework : resource >
2263
+ <framework : resource name =" invoice" >redis://r2.docker</framework : resource >
2264
+ <framework : resource name =" report" >semaphore</framework : resource >
2265
+ </framework : lock >
2266
+ </framework : config >
2267
+ </container >
2268
+
2269
+ .. code-block :: php
2270
+
2271
+ // app/config/config.php
2272
+ $container->loadFromExtension('framework', [
2273
+ // these are all the supported lock stores
2274
+ 'lock' => null,
2275
+ 'lock' => 'flock',
2276
+ 'lock' => 'semaphore',
2277
+ 'lock' => 'memcached://m1.docker',
2278
+ 'lock' => ['memcached://m1.docker', 'memcached://m2.docker'],
2279
+ 'lock' => 'redis://r1.docker',
2280
+ 'lock' => ['redis://r1.docker', 'redis://r2.docker'],
2281
+ 'lock' => '%env(MEMCACHED_OR_REDIS_URL)%',
2282
+
2283
+ // named locks
2284
+ 'lock' => [
2285
+ 'invoice' => ['redis://r1.docker', 'redis://r2.docker'],
2286
+ 'report' => 'semaphore',
2287
+ ],
2288
+ ]);
2289
+
2290
+ .. _reference-lock-resources-name :
2291
+
2292
+ name
2293
+ """"
2294
+
2295
+ **type **: ``prototype ``
2296
+
2297
+ Name of the lock you want to create.
2298
+
2299
+ .. tip ::
2300
+
2301
+ If you want to use the `RetryTillSaveStore ` for :ref: `non-blocking locks <lock-blocking-locks >`,
2302
+ you can do it by :doc: `decorating the store </service_container/service_decoration >` service:
2303
+
2304
+ .. code-block :: yaml
2305
+
2306
+ lock.invoice.retry_till_save.store :
2307
+ class : Symfony\Component\Lock\Store\RetryTillSaveStore
2308
+ decorates : lock.invoice.store
2309
+ arguments : ['@lock.invoice.retry.till.save.store.inner', 100, 50]
2310
+
2183
2311
workflows
2184
2312
~~~~~~~~~
2185
2313
0 commit comments