services.yaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # Put parameters here that don't need to change on each machine where the app is deployed
  2. # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
  3. parameters:
  4. services:
  5. ########### Speeds up api-platform cache build substantially ###########
  6. #### see https://github.com/api-platform/core/issues/4975 ####
  7. api_platform.cache.metadata.property:
  8. parent: cache.system
  9. tags: [ cache.pool ]
  10. api_platform.cache.metadata.resource:
  11. parent: cache.system
  12. tags: [ cache.pool ]
  13. api_platform.cache.metadata.resource_collection:
  14. parent: cache.system
  15. tags: [ cache.pool ]
  16. api_platform.cache.route_name_resolver:
  17. parent: cache.system
  18. tags: [ cache.pool ]
  19. api_platform.cache.identifiers_extractor:
  20. parent: cache.system
  21. tags: [ cache.pool ]
  22. api_platform.elasticsearch.cache.metadata.document:
  23. parent: cache.system
  24. tags: [ cache.pool ]
  25. # May have to be removed soon when api-platform removes these services
  26. # see vendor/api-platform/core/src/Symfony/Bundle/Resources/config/metadata/property.xml:41
  27. api_platform.cache.metadata.identifier:
  28. parent: cache.adapter.array
  29. tags: [ cache.pool ]
  30. api_platform.metadata.property.identifier_metadata_factory.cached:
  31. class: ApiPlatform\Metadata\Property\Factory\CachedPropertyMetadataFactory
  32. decorates: api_platform.metadata.property.identifier_metadata_factory
  33. decoration_priority: 99
  34. arguments:
  35. - '@api_platform.cache.metadata.identifier'
  36. - '@api_platform.metadata.property.identifier_metadata_factory.cached.inner'
  37. ########### End Speeds up api-platform cache build substantially ###########
  38. # default configuration for services in *this* file
  39. _defaults:
  40. autowire: true # Automatically injects dependencies in your services.
  41. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
  42. bind:
  43. $opentalentConfig: '%kernel.project_dir%%env(OPENTALENT_CONFIG)%'
  44. $internalFilesUploadUri: '%env(INTERNAL_FILES_DOWNLOAD_URI)%'
  45. $bindfileBufferFile: '%env(BIND_FILE_BUFFER_FILE)%'
  46. $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
  47. $removeProcessor: '@api_platform.doctrine.orm.state.remove_processor'
  48. $opentalentNoReplyEmailAddress: 'noreply@opentalent.fr'
  49. # Logging: a shorter version of the default monolog line formatter
  50. monolog.formatter.message:
  51. class: Monolog\Formatter\LineFormatter
  52. arguments:
  53. - "[%%datetime%%] %%level_name%% : %%message%%\n"
  54. - "Y-m-d H:i:s.v"
  55. # makes classes in src/ available to be used as services
  56. # this creates a service per class whose id is the fully-qualified class name
  57. App\:
  58. resource: '../src/*'
  59. exclude:
  60. - '../src/DependencyInjection/'
  61. - '../src/Entity/'
  62. - '../src/Kernel.php'
  63. - '../src/Tests/'
  64. App\OpenApi\OpenApiFactory:
  65. decorates: 'api_platform.openapi.factory'
  66. arguments: [ '@App\OpenApi\OpenApiFactory.inner' ]
  67. autoconfigure: false
  68. App\Service\Cotisation\Utils:
  69. public: true
  70. App\Service\Network\Utils:
  71. public: true
  72. App\Service\Organization\Utils:
  73. public: true
  74. Gaufrette\Filesystem: '@knp_gaufrette.filesystem_map'
  75. #########################################
  76. ## TAG Services ##
  77. _instanceof:
  78. App\Doctrine\Access\AccessExtensionInterface:
  79. tags: ['app.extensions.access']
  80. App\Service\Access\OptionalsRolesInterface:
  81. tags: ['app.optionalsroles']
  82. App\Service\Export\ExporterInterface:
  83. tags: ['app.exporter']
  84. App\Service\Export\Encoder\EncoderInterface:
  85. tags: ['app.encoder']
  86. App\Service\Mailer\Builder\BuilderInterface:
  87. tags: [ 'app.mailer.builder' ]
  88. App\Service\Twig\AssetsExtension:
  89. tags: [ 'twig.extension' ]
  90. App\Service\Cron\CronjobInterface:
  91. tags: [ 'app.cronjob' ]
  92. App\Service\ServiceIterator\CurrentAccessExtensionIterator:
  93. - !tagged_iterator app.extensions.access
  94. App\Service\ServiceIterator\OptionalsRolesIterator:
  95. - !tagged_iterator app.optionalsroles
  96. App\Service\ServiceIterator\ExporterIterator:
  97. - !tagged_iterator app.exporter
  98. App\Service\ServiceIterator\EncoderIterator:
  99. - !tagged_iterator app.encoder
  100. App\Service\ServiceIterator\Mailer\BuilderIterator:
  101. - !tagged_iterator app.mailer.builder
  102. App\Service\ServiceIterator\CronjobIterator:
  103. - !tagged_iterator app.cronjob
  104. #########################################
  105. ## SERIALIZER Decorates ##
  106. App\Serializer\DefaultNormalizer:
  107. # By default .inner is passed as argument
  108. decorates: 'api_platform.jsonld.normalizer.item'
  109. app.serializer.normalizer.item.json:
  110. class: 'App\Serializer\DefaultNormalizer'
  111. decorates: 'api_platform.serializer.normalizer.item'
  112. App\Serializer\AccessContextBuilder:
  113. decorates: 'api_platform.serializer.context_builder'
  114. arguments: [ '@App\Serializer\AccessContextBuilder.inner' ]
  115. autoconfigure: false
  116. #########################################
  117. ## LISTENER ##
  118. App\EventListener\DoctrineFilter\DoctrineFilterListener:
  119. tags:
  120. - { name: kernel.event_listener, event: kernel.request }
  121. #########################################
  122. ## ELASTIC SERVICE ##
  123. App\Service\Elasticsearch\EducationNotationUpdater:
  124. arguments:
  125. - '@fos_elastica.object_persister.search.educationNotation'
  126. #########################################
  127. ## AutoWiring du service container ##
  128. Symfony\Component\DependencyInjection\ContainerInterface: '@service_container'
  129. #########################################