Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9ad492f

Browse filesBrowse files
committed
feature #26923 [FrameworkBundle] Allow user to specify folder for flock (MaksSlesarenko)
This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Allow user to specify folder for flock | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | License | MIT | Doc PR | In case multiple applications running on same server allow user to specify folder for flock example: ``` framework: lock:` 'flock://var/flock' # var/flock will be provided as path to flock constructor lock: 'flock:///var/flock' # /var/flock will be provided as path to flock constructor lock: flock # works as usual, null is provided to constructor and system temp folder is used ``` Commits ------- 244d762 added ability to specify folder for flock
2 parents a37bca4 + 244d762 commit 9ad492f
Copy full SHA for 9ad492f

File tree

1 file changed

+9
-0
lines changed
Filter options

1 file changed

+9
-0
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
use Symfony\Component\Lock\Factory;
6565
use Symfony\Component\Lock\Lock;
6666
use Symfony\Component\Lock\LockInterface;
67+
use Symfony\Component\Lock\Store\FlockStore;
6768
use Symfony\Component\Lock\Store\StoreFactory;
6869
use Symfony\Component\Lock\StoreInterface;
6970
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
@@ -1405,6 +1406,14 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
14051406
case 'flock' === $storeDsn:
14061407
$storeDefinition = new Reference('lock.store.flock');
14071408
break;
1409+
case 0 === strpos($storeDsn, 'flock://'):
1410+
$flockPath = substr($storeDsn, 8);
1411+
1412+
$storeDefinitionId = '.lock.flock.store.'.$container->hash($storeDsn);
1413+
$container->register($storeDefinitionId, FlockStore::class)->addArgument($flockPath);
1414+
1415+
$storeDefinition = new Reference($storeDefinitionId);
1416+
break;
14081417
case 'semaphore' === $storeDsn:
14091418
$storeDefinition = new Reference('lock.store.semaphore');
14101419
break;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.