File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ this behavior by using the ``lock`` key like:
62
62
lock : ' oci:host=127.0.0.1;dbname=app'
63
63
lock : ' mongodb://127.0.0.1/app?collection=lock'
64
64
lock : ' %env(LOCK_DSN)%'
65
+ # using an existing service
66
+ lock : ' snc_redis.default'
65
67
66
68
# named locks
67
69
lock :
@@ -119,6 +121,9 @@ this behavior by using the ``lock`` key like:
119
121
120
122
<framework : resource >%env(LOCK_DSN)%</framework : resource >
121
123
124
+ <!-- using an existing service -->
125
+ <framework : resource >snc_redis.default</framework : resource >
126
+
122
127
<!-- named locks -->
123
128
<framework : resource name =" invoice" >semaphore</framework : resource >
124
129
<framework : resource name =" invoice" >redis://r2.docker</framework : resource >
@@ -152,6 +157,8 @@ this behavior by using the ``lock`` key like:
152
157
->resource('default', ['oci:host=127.0.0.1;dbname=app'])
153
158
->resource('default', ['mongodb://127.0.0.1/app?collection=lock'])
154
159
->resource('default', [env('LOCK_DSN')])
160
+ // using an existing service
161
+ ->resource('default', ['snc_redis.default'])
155
162
156
163
// named locks
157
164
->resource('invoice', ['semaphore', 'redis://r2.docker'])
Original file line number Diff line number Diff line change @@ -2048,7 +2048,7 @@ resources
2048
2048
**type **: ``array ``
2049
2049
2050
2050
A map of lock stores to be created by the framework extension, with
2051
- the name as key and DSN as value:
2051
+ the name as key and DSN or service id as value:
2052
2052
2053
2053
.. configuration-block ::
2054
2054
@@ -2725,7 +2725,7 @@ resources
2725
2725
**type **: ``array ``
2726
2726
2727
2727
A map of semaphore stores to be created by the framework extension, with
2728
- the name as key and DSN as value:
2728
+ the name as key and DSN or service id as value:
2729
2729
2730
2730
.. configuration-block ::
2731
2731
@@ -2756,11 +2756,12 @@ the name as key and DSN as value:
2756
2756
.. code-block :: php
2757
2757
2758
2758
// config/packages/semaphore.php
2759
+ use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
2759
2760
use Symfony\Config\FrameworkConfig;
2760
2761
2761
2762
return static function (FrameworkConfig $framework): void {
2762
2763
$framework->semaphore()
2763
- ->resource('default', ['% env(SEMAPHORE_DSN)%' ]);
2764
+ ->resource('default', [env(' SEMAPHORE_DSN') ]);
2764
2765
};
2765
2766
2766
2767
.. _reference-semaphore-resources-name :
You can’t perform that action at this time.
0 commit comments