|
28 | 28 | use Symfony\Bundle\FullStack;
|
29 | 29 | use Symfony\Component\Asset\PackageInterface;
|
30 | 30 | use Symfony\Component\BrowserKit\AbstractBrowser;
|
31 |
| -use Symfony\Component\Cache\Adapter\AbstractAdapter; |
32 | 31 | use Symfony\Component\Cache\Adapter\AdapterInterface;
|
33 | 32 | use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
34 | 33 | use Symfony\Component\Cache\Adapter\ChainAdapter;
|
|
75 | 74 | use Symfony\Component\Lock\LockFactory;
|
76 | 75 | use Symfony\Component\Lock\LockInterface;
|
77 | 76 | use Symfony\Component\Lock\PersistingStoreInterface;
|
78 |
| -use Symfony\Component\Lock\Store\FlockStore; |
79 | 77 | use Symfony\Component\Lock\Store\StoreFactory;
|
80 | 78 | use Symfony\Component\Lock\StoreInterface;
|
81 | 79 | use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
|
@@ -1621,42 +1619,13 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
|
1621 | 1619 | $storeDefinitions = [];
|
1622 | 1620 | foreach ($resourceStores as $storeDsn) {
|
1623 | 1621 | $storeDsn = $container->resolveEnvPlaceholders($storeDsn, null, $usedEnvs);
|
1624 |
| - switch (true) { |
1625 |
| - case 'flock' === $storeDsn: |
1626 |
| - $storeDefinition = new Reference('lock.store.flock'); |
1627 |
| - break; |
1628 |
| - case 0 === strpos($storeDsn, 'flock://'): |
1629 |
| - $flockPath = substr($storeDsn, 8); |
1630 |
| - |
1631 |
| - $storeDefinitionId = '.lock.flock.store.'.$container->hash($storeDsn); |
1632 |
| - $container->register($storeDefinitionId, FlockStore::class)->addArgument($flockPath); |
1633 |
| - |
1634 |
| - $storeDefinition = new Reference($storeDefinitionId); |
1635 |
| - break; |
1636 |
| - case 'semaphore' === $storeDsn: |
1637 |
| - $storeDefinition = new Reference('lock.store.semaphore'); |
1638 |
| - break; |
1639 |
| - case $usedEnvs || preg_match('#^[a-z]++://#', $storeDsn): |
1640 |
| - if (!$container->hasDefinition($connectionDefinitionId = '.lock_connection.'.$container->hash($storeDsn))) { |
1641 |
| - $connectionDefinition = new Definition(\stdClass::class); |
1642 |
| - $connectionDefinition->setPublic(false); |
1643 |
| - $connectionDefinition->setFactory([AbstractAdapter::class, 'createConnection']); |
1644 |
| - $connectionDefinition->setArguments([$storeDsn, ['lazy' => true]]); |
1645 |
| - $container->setDefinition($connectionDefinitionId, $connectionDefinition); |
1646 |
| - } |
1647 |
| - |
1648 |
| - $storeDefinition = new Definition(PersistingStoreInterface::class); |
1649 |
| - $storeDefinition->setPublic(false); |
1650 |
| - $storeDefinition->setFactory([StoreFactory::class, 'createStore']); |
1651 |
| - $storeDefinition->setArguments([new Reference($connectionDefinitionId)]); |
| 1622 | + $storeDefinition = new Definition(PersistingStoreInterface::class); |
| 1623 | + $storeDefinition->setFactory([StoreFactory::class, 'createStore']); |
| 1624 | + $storeDefinition->setArguments([$storeDsn]); |
1652 | 1625 |
|
1653 |
| - $container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $storeDefinition); |
| 1626 | + $container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $storeDefinition); |
1654 | 1627 |
|
1655 |
| - $storeDefinition = new Reference($storeDefinitionId); |
1656 |
| - break; |
1657 |
| - default: |
1658 |
| - throw new InvalidArgumentException(sprintf('Lock store DSN "%s" is not valid in resource "%s"', $storeDsn, $resourceName)); |
1659 |
| - } |
| 1628 | + $storeDefinition = new Reference($storeDefinitionId); |
1660 | 1629 |
|
1661 | 1630 | $storeDefinitions[] = $storeDefinition;
|
1662 | 1631 | }
|
|
0 commit comments