|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
| 4 | + |
| 5 | +return static function(ContainerConfigurator $container) { |
| 6 | + $services = $container->services(); |
| 7 | + $parameters = $container->parameters(); |
| 8 | + $parameters->set('fos_elastica.property_accessor.magicCall', 0); |
| 9 | + $parameters->set('fos_elastica.property_accessor.throwExceptionOnInvalidIndex', 0); |
| 10 | + |
| 11 | + $services->set('fos_elastica.client_prototype', 'FOS\ElasticaBundle\Elastica\Client') |
| 12 | + ->abstract() |
| 13 | + ->args([ |
| 14 | + '$config' => abstract_arg('configuration for Ruflin Client'), |
| 15 | + '$forbiddenCodes' => abstract_arg('list of forbidden codes for Client'), |
| 16 | + '$logger' => abstract_arg('logger for Ruflin Client'), |
| 17 | + ]) |
| 18 | + ->call('setStopwatch', [service('debug.stopwatch')->nullOnInvalid()]) |
| 19 | + ->call('setEventDispatcher', [service('event_dispatcher')->nullOnInvalid()]); |
| 20 | + |
| 21 | + $services->set('FOS\ElasticaBundle\Elastica\NodePool\RoundRobinResurrect') |
| 22 | + ->factory([null, 'create']); |
| 23 | + |
| 24 | + $services->set('FOS\ElasticaBundle\Elastica\NodePool\RoundRobinNoResurrect') |
| 25 | + ->factory([null, 'create']); |
| 26 | + |
| 27 | + $services->set('fos_elastica.config_manager', 'FOS\ElasticaBundle\Configuration\ConfigManager') |
| 28 | + ->args([[]]); |
| 29 | + |
| 30 | + $services->alias('FOS\ElasticaBundle\Configuration\ConfigManager', 'fos_elastica.config_manager'); |
| 31 | + |
| 32 | + $services->set('fos_elastica.config_manager.index_templates', 'FOS\ElasticaBundle\Configuration\ConfigManager') |
| 33 | + ->args([[]]); |
| 34 | + |
| 35 | + $services->set('fos_elastica.data_collector', 'FOS\ElasticaBundle\DataCollector\ElasticaDataCollector') |
| 36 | + ->args([service('fos_elastica.logger')]) |
| 37 | + ->tag('data_collector', ['template' => '@FOSElastica/Collector/elastica.html.twig', 'id' => 'elastica']); |
| 38 | + |
| 39 | + $services->set('fos_elastica.paginator.subscriber', 'FOS\ElasticaBundle\Subscriber\PaginateElasticaQuerySubscriber') |
| 40 | + ->args([service('request_stack')]) |
| 41 | + ->tag('kernel.event_subscriber'); |
| 42 | + |
| 43 | + $services->set('fos_elastica.logger', 'FOS\ElasticaBundle\Logger\ElasticaLogger') |
| 44 | + ->args([ |
| 45 | + service('logger')->nullOnInvalid(), |
| 46 | + '%kernel.debug%', |
| 47 | + ]) |
| 48 | + ->tag('monolog.logger', ['channel' => 'elastica']); |
| 49 | + |
| 50 | + $services->set('fos_elastica.mapping_builder', 'FOS\ElasticaBundle\Index\MappingBuilder') |
| 51 | + ->args([service('event_dispatcher')]); |
| 52 | + |
| 53 | + $services->set('fos_elastica.property_accessor', 'Symfony\Component\PropertyAccess\PropertyAccessor') |
| 54 | + ->args([ |
| 55 | + '%fos_elastica.property_accessor.magicCall%', |
| 56 | + '%fos_elastica.property_accessor.throwExceptionOnInvalidIndex%', |
| 57 | + ]); |
| 58 | +}; |
0 commit comments