services.yaml 5.4 KB

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