|
27 | 27 | use Symfony\Bundle\FullStack;
|
28 | 28 | use Symfony\Component\Asset\PackageInterface;
|
29 | 29 | use Symfony\Component\BrowserKit\AbstractBrowser;
|
30 |
| -use Symfony\Component\Cache\Adapter\AbstractAdapter; |
31 | 30 | use Symfony\Component\Cache\Adapter\AdapterInterface;
|
32 | 31 | use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
33 | 32 | use Symfony\Component\Cache\Adapter\ChainAdapter;
|
|
73 | 72 | use Symfony\Component\Lock\LockFactory;
|
74 | 73 | use Symfony\Component\Lock\LockInterface;
|
75 | 74 | use Symfony\Component\Lock\PersistingStoreInterface;
|
76 |
| -use Symfony\Component\Lock\Store\FlockStore; |
77 | 75 | use Symfony\Component\Lock\Store\StoreFactory;
|
78 | 76 | use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
|
79 | 77 | use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory;
|
@@ -1487,42 +1485,13 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
|
1487 | 1485 | $storeDefinitions = [];
|
1488 | 1486 | foreach ($resourceStores as $storeDsn) {
|
1489 | 1487 | $storeDsn = $container->resolveEnvPlaceholders($storeDsn, null, $usedEnvs);
|
1490 |
| - switch (true) { |
1491 |
| - case 'flock' === $storeDsn: |
1492 |
| - $storeDefinition = new Reference('lock.store.flock'); |
1493 |
| - break; |
1494 |
| - case 0 === strpos($storeDsn, 'flock://'): |
1495 |
| - $flockPath = substr($storeDsn, 8); |
1496 |
| - |
1497 |
| - $storeDefinitionId = '.lock.flock.store.'.$container->hash($storeDsn); |
1498 |
| - $container->register($storeDefinitionId, FlockStore::class)->addArgument($flockPath); |
1499 |
| - |
1500 |
| - $storeDefinition = new Reference($storeDefinitionId); |
1501 |
| - break; |
1502 |
| - case 'semaphore' === $storeDsn: |
1503 |
| - $storeDefinition = new Reference('lock.store.semaphore'); |
1504 |
| - break; |
1505 |
| - case $usedEnvs || preg_match('#^[a-z]++://#', $storeDsn): |
1506 |
| - if (!$container->hasDefinition($connectionDefinitionId = '.lock_connection.'.$container->hash($storeDsn))) { |
1507 |
| - $connectionDefinition = new Definition(\stdClass::class); |
1508 |
| - $connectionDefinition->setPublic(false); |
1509 |
| - $connectionDefinition->setFactory([AbstractAdapter::class, 'createConnection']); |
1510 |
| - $connectionDefinition->setArguments([$storeDsn, ['lazy' => true]]); |
1511 |
| - $container->setDefinition($connectionDefinitionId, $connectionDefinition); |
1512 |
| - } |
1513 |
| - |
1514 |
| - $storeDefinition = new Definition(PersistingStoreInterface::class); |
1515 |
| - $storeDefinition->setPublic(false); |
1516 |
| - $storeDefinition->setFactory([StoreFactory::class, 'createStore']); |
1517 |
| - $storeDefinition->setArguments([new Reference($connectionDefinitionId)]); |
| 1488 | + $storeDefinition = new Definition(PersistingStoreInterface::class); |
| 1489 | + $storeDefinition->setFactory([StoreFactory::class, 'createStore']); |
| 1490 | + $storeDefinition->setArguments([$storeDsn]); |
1518 | 1491 |
|
1519 |
| - $container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $storeDefinition); |
| 1492 | + $container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $storeDefinition); |
1520 | 1493 |
|
1521 |
| - $storeDefinition = new Reference($storeDefinitionId); |
1522 |
| - break; |
1523 |
| - default: |
1524 |
| - throw new InvalidArgumentException(sprintf('Lock store DSN "%s" is not valid in resource "%s"', $storeDsn, $resourceName)); |
1525 |
| - } |
| 1494 | + $storeDefinition = new Reference($storeDefinitionId); |
1526 | 1495 |
|
1527 | 1496 | $storeDefinitions[] = $storeDefinition;
|
1528 | 1497 | }
|
|
0 commit comments