# 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: locale: en app_locales: en|de 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. public: false # Allows optimizing the container by removing unused services; this also means # fetching services directly from the container via $container->get() won't work. # The best practice is to be explicit about your dependencies anyway. bind: $projectDirectory: "%kernel.project_dir%" # 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/{Entity,Migrations,Tests}' # 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/Controller' tags: ['controller.service_arguments'] # ================================================================================ # APPLICATION CORE # ================================================================================ App\Invoice\ServiceInvoice: class: App\Invoice\ServiceInvoice arguments: ['%kimai.invoice%', '@service_container'] # a route listener, that injects the locale through a URL directory App\EventSubscriber\RedirectToLocaleSubscriber: class: App\EventSubscriber\RedirectToLocaleSubscriber arguments: ['@router', '%app_locales%', '%locale%'] tags: - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } # ================================================================================ # DATABASE # ================================================================================ # service that prefixes every database table App\Doctrine\TablePrefixSubscriber: class: App\Doctrine\TablePrefixSubscriber arguments: ["%env(resolve:DATABASE_PREFIX)%"] tags: - { name: doctrine.event_subscriber } # updates timesheet records, to make sure they are calculated and can't be manipulated by the users App\Doctrine\TimesheetSubscriber: class: App\Doctrine\TimesheetSubscriber tags: - { name: doctrine.event_listener, event: prePersist, lazy: true } - { name: doctrine.event_listener, event: preUpdate, lazy: true } # Uncomment the following lines to define a service for the Timesheet Doctrine repository # # app.timesheet_repository: # class: Doctrine\ORM\EntityRepository # factory: ['@doctrine.orm.entity_manager', getRepository] # arguments: [App\Entity\Timesheet] # ================================================================================ # FORMS # ================================================================================ # form type to edit user roles App\Form\Type\UserRoleType: class: App\Form\Type\UserRoleType arguments: ["%security.role_hierarchy.roles%"] tags: - { name: form.type } # ================================================================================ # THEME # ================================================================================ App\Twig\Extensions: arguments: ['%app_locales%'] # avanzu_admin_theme.navbar_task_listener: # class: "%avanzu_admin_theme.navbar_task_listener.class%" # tags: # - { name: kernel.event_listener, event: theme.tasks, method: onListTasks } # # avanzu_admin_theme.navbar_notify_listener: # class: "%avanzu_admin_theme.navbar_notify_listener.class%" # tags: # - { name: kernel.event_listener, event: theme.notifications, method: onListNotifications } # # avanzu_admin_theme.navbar_msg_listener: # class: "%avanzu_admin_theme.navbar_msg_listener.class%" # tags: # - { name: kernel.event_listener, event: theme.messages, method: onListMessages }