lock.php 1.0 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\Lock\LockFactory;
  12. use Symfony\Component\Lock\Store\CombinedStore;
  13. use Symfony\Component\Lock\Strategy\ConsensusStrategy;
  14. return static function (ContainerConfigurator $container) {
  15. $container->services()
  16. ->set('lock.store.combined.abstract', CombinedStore::class)->abstract()
  17. ->args([abstract_arg('List of stores'), service('lock.strategy.majority')])
  18. ->set('lock.strategy.majority', ConsensusStrategy::class)
  19. ->set('lock.factory.abstract', LockFactory::class)->abstract()
  20. ->args([abstract_arg('Store')])
  21. ->call('setLogger', [service('logger')->ignoreOnInvalid()])
  22. ->tag('monolog.logger', ['channel' => 'lock'])
  23. ;
  24. };