175 lines
8.0 KiB
YAML
175 lines
8.0 KiB
YAML
# This file is the entry point to configure your own services.
|
|
# Files in the packages/ subdirectory configure your dependencies.
|
|
|
|
# Put parameters here that don't need to change on each machine where the app is deployed
|
|
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
|
parameters:
|
|
# ignore
|
|
elasticsearch_config:
|
|
hosts: '%env(csv:ELASTICSEARCH_DSNS)%'
|
|
#end-ignore
|
|
services:
|
|
# default configuration for services in *this* file
|
|
_defaults:
|
|
autowire: true # Automatically injects dependencies in your services.
|
|
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
|
bind:
|
|
# ignore
|
|
Cheeper\AllChapters\DomainModel\Cheep\Cheeps $cheeps: '@Cheeper\AllChapters\Infrastructure\Persistence\DoctrineOrmCheeps'
|
|
Cheeper\AllChapters\DomainModel\Author\Authors $authors: '@Cheeper\AllChapters\Infrastructure\Persistence\DoctrineOrmAuthors'
|
|
Cheeper\AllChapters\DomainModel\Author\Authors $authorsRepository: '@Cheeper\AllChapters\Infrastructure\Persistence\DoctrineOrmAuthors'
|
|
Cheeper\AllChapters\DomainModel\Follow\Follows $follows: '@Cheeper\AllChapters\Infrastructure\Persistence\DoctrineOrmFollows'
|
|
|
|
#end-ignore
|
|
Symfony\Component\Messenger\MessageBusInterface $commandBus: "@command.bus"
|
|
# ignore
|
|
Symfony\Component\Messenger\MessageBusInterface $queryBus: "@query.bus"
|
|
Symfony\Component\Messenger\MessageBusInterface $eventBus: "@event.bus"
|
|
Symfony\Component\Messenger\MessageBusInterface $projectionBus: "@projection.bus"
|
|
|
|
Cheeper\Chapter5\DomainModel\Follow\Followers: '@Cheeper\Chapter5\Infrastructure\Persistence\DoctrineOrmFollowers'
|
|
Cheeper\Chapter5\Application\Query\QueryBus: '@Cheeper\Chapter5\Infrastructure\Application\Query\SymfonyQueryBus'
|
|
Cheeper\Chapter6\Application\Event\EventBus: '@Cheeper\Chapter6\Infrastructure\Application\Event\SymfonyEventBus'
|
|
|
|
Architecture\CQRS\App\Repository\FollowersRepository: '@Architecture\CQRS\Infrastructure\Persistence\Doctrine\DoctrineFollowersRepository'
|
|
Redis: '@snc_redis.default'
|
|
|
|
# makes classes in src/ available to be used as services
|
|
# this creates a service per class whose id is the fully-qualified class name
|
|
App\:
|
|
resource: '../src/App/*'
|
|
exclude:
|
|
- '../src/App/{DependencyInjection,Entity,Migrations,Tests,Kernel.php,Helpers}'
|
|
- '../src/App/Messenger/FromScratch.php'
|
|
- '../src/App/Messenger/FromScratchWithCustomMiddleware.php'
|
|
|
|
# controllers are imported separately to make sure services can be injected
|
|
# as action arguments even if you don't extend any base controller class
|
|
App\Controller\:
|
|
resource: '../src/App/Controller'
|
|
tags: ['controller.service_arguments']
|
|
|
|
# add more service definitions when explicit configuration is needed
|
|
# please note that last definitions always *replace* previous ones
|
|
App\ArgumentResolver\UuidResolver:
|
|
tags:
|
|
- { name: controller.argument_value_resolver, priority: 200 }
|
|
|
|
ApiPlatform\Core\Bridge\RamseyUuid\Identifier\Normalizer\UuidNormalizer:
|
|
tags:
|
|
- { name: api_platform.identifier.denormalizer }
|
|
|
|
Cheeper\AllChapters\Infrastructure\:
|
|
resource: '../src/Cheeper/AllChapters/Infrastructure/**/*.php'
|
|
|
|
Cheeper\AllChapters\Application\Command\:
|
|
resource: '../src/Cheeper/AllChapters/Application/Command/**/*Handler.php'
|
|
autoconfigure: false
|
|
tags:
|
|
- { name: messenger.message_handler, bus: command.bus }
|
|
|
|
Cheeper\Chapter5\Application\Query\:
|
|
resource: '../src/Cheeper/Chapter5/Application/Query/**/*Handler.php'
|
|
autoconfigure: false
|
|
tags:
|
|
- { name: messenger.message_handler, bus: query.bus }
|
|
|
|
Cheeper\Chapter5\Infrastructure\:
|
|
resource: '../src/Cheeper/Chapter5/Infrastructure/**/*.php'
|
|
|
|
Cheeper\Chapter6\Infrastructure\:
|
|
resource: '../src/Cheeper/Chapter6/Infrastructure/**/*.php'
|
|
|
|
# CHAPTER 4
|
|
Cheeper\Chapter4\DomainModel\Author\AuthorRepository:
|
|
class: 'Cheeper\Chapter4\Infrastructure\DomainModel\Author\DoctrineOrmAuthorRepository'
|
|
Cheeper\Chapter4\DomainModel\Cheep\CheepRepository:
|
|
class: 'Cheeper\Chapter4\Infrastructure\DomainModel\Cheep\DoctrineOrmCheepRepository'
|
|
Cheeper\Chapter4\DomainModel\Follow\FollowRepository:
|
|
class: 'Cheeper\Chapter4\Infrastructure\DomainModel\Follow\DoctrineOrmFollowRepository'
|
|
|
|
# CHAPTER 5
|
|
Cheeper\Chapter5\Infrastructure\Application\Query\SymfonyQueryBus: ~
|
|
Architecture\CQRS\Infrastructure\Persistence\Doctrine\DoctrineFollowersRepository: ~
|
|
|
|
# CHAPTER 6
|
|
# Cheeper\Chapter6\Infrastructure\Application\Projector\Author\SymfonyAuthorFollowedHandler:
|
|
# resource: '../src/Cheeper/Infrastructure/**/*.php'
|
|
|
|
Cheeper\Chapter6\Application\Projector\Author\CountFollowerProjector: ~
|
|
|
|
Cheeper\Chapter6\Application\Command\Author\WithDomainEvents\FollowHandler:
|
|
tags:
|
|
- { name: messenger.message_handler, bus: command.bus }
|
|
class: 'Cheeper\Chapter6\Application\Command\Author\WithDomainEvents\FollowHandler'
|
|
|
|
Cheeper\Chapter6\Infrastructure\Application\Projector\Author\SymfonyCountFollowerProjector:
|
|
tags:
|
|
- { name: messenger.message_handler, bus: command.bus }
|
|
arguments:
|
|
- '@Cheeper\Chapter6\Application\Projector\Author\CountFollowerProjector'
|
|
|
|
Cheeper\Chapter6\Infrastructure\Application\Projector\Author\SymfonyAuthorFollowedHandler:
|
|
tags:
|
|
- { name: messenger.message_handler, bus: event.bus }
|
|
class: 'Cheeper\Chapter6\Infrastructure\Application\Projector\Author\SymfonyAuthorFollowedHandler'
|
|
|
|
# CHAPTER 7
|
|
Cheeper\Chapter7\:
|
|
resource: '../src/Cheeper/Chapter7/*'
|
|
|
|
Cheeper\Chapter7\DomainModel\Author\AuthorRepository:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Persistence\DoctrineOrmAuthorRepository'
|
|
|
|
Cheeper\Chapter7\DomainModel\Cheep\CheepRepository:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Persistence\DoctrineOrmCheepRepository'
|
|
|
|
Cheeper\Chapter7\DomainModel\Follow\FollowRepository:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Persistence\DoctrineOrmFollowRepository'
|
|
|
|
Cheeper\Chapter7\Application\CommandBus:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Application\SymfonyCommandBus'
|
|
|
|
Cheeper\Chapter7\Application\QueryBus:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Application\SymfonyQueryBus'
|
|
|
|
Cheeper\Chapter7\Application\EventBus:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Application\SymfonyEventBus'
|
|
|
|
Cheeper\Chapter7\Application\ProjectionBus:
|
|
class: 'Cheeper\Chapter7\Infrastructure\Application\SymfonyProjectionBus'
|
|
|
|
chapter7_command_handlers:
|
|
namespace: Cheeper\Chapter7\Application\
|
|
resource: '../src/Cheeper/Chapter7/Application/**/*CommandHandler.php'
|
|
tags:
|
|
- { name: messenger.message_handler, bus: command.bus }
|
|
|
|
chapter7_event_handlers:
|
|
namespace: Cheeper\Chapter7\Application\
|
|
resource: '../src/Cheeper/Chapter7/Application/**/Symfony*EventHandler.php'
|
|
tags:
|
|
- { name: messenger.message_handler, bus: event.bus }
|
|
|
|
chapter7_query_handlers:
|
|
namespace: Cheeper\Chapter7\Application\
|
|
resource: '../src/Cheeper/Chapter7/Application/**/*QueryHandler.php'
|
|
tags:
|
|
- { name: messenger.message_handler, bus: query.bus }
|
|
|
|
chapter7_projection_handlers:
|
|
namespace: Cheeper\Chapter7\Application\
|
|
resource: '../src/Cheeper/Chapter7/Application/**/Symfony*ProjectionHandler.php'
|
|
tags:
|
|
- { name: messenger.message_handler, bus: projection.bus }
|
|
|
|
App\EventListener\UserCreatedListener:
|
|
tags:
|
|
- name: "doctrine.orm.entity_listener"
|
|
event: "postPersist"
|
|
entity: 'App\Entity\User'
|
|
|
|
Elasticsearch\Client:
|
|
factory: [ 'Elasticsearch\ClientBuilder', fromConfig ]
|
|
arguments: [ '%elasticsearch_config%' ]
|
|
#end-ignore |