Skip to content
Snippets Groups Projects
services.yaml 2.7 KiB
Newer Older
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
# 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.html#use-parameters-for-application-configuration
parameters:
    confirm_type: '%env(CONFIRM_TYPE)%'
    code_ttl: '%env(CODE_TTL)%'
    from_email: '%env(MAILER_ADDRESS)%'
    # Директория сохранения файлов
    images_directory: '%kernel.project_dir%/public/uploads/user_images'
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed

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.

    # 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/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'

    App\Service\Action\Classes\SaveImage:
        arguments:
            $targetDirectory: '%images_directory%'

    # Сервис отправки
    App\Service\Send\SendService:
        arguments:
            $confirmType: '%confirm_type%'
            $fromEmail: '%from_email%'

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    App\Listeners\KernelExceptionListener:
        tags:
            - { name: kernel.event_listener, event: kernel.exception }
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    # События JWT авторизации
    acme_api.event.authentication_success_listener:
        class: App\Listeners\JwtListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }

    acme_api.event.authentication_failure_listener:
        class: App\Listeners\JwtListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_failure, method: onAuthenticationFailureResponse }

    acme_api.event.jwt_invalid_listener:
        class: App\Listeners\JwtListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_jwt_invalid, method: onJWTInvalid }

    acme_api.event.jwt_notfound_listener:
        class: App\Listeners\JwtListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_jwt_not_found, method: onJWTNotFound }

    acme_api.event.jwt_expired_listener:
        class: App\Listeners\JwtListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_jwt_expired, method: onJWTExpired }