services.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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. # default configuration for services in *this* file
  6. _defaults:
  7. autowire: true # Automatically injects dependencies in your services.
  8. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
  9. public: false # Allows optimizing the container by removing unused services; this also means
  10. # fetching services directly from the container via $container->get() won't work.
  11. # The best practice is to be explicit about your dependencies anyway.
  12. # makes classes in src/ available to be used as services
  13. # this creates a service per class whose id is the fully-qualified class name
  14. App\:
  15. resource: '../src/*'
  16. # Exclude the local bundle namespaces.
  17. exclude: '../src/{Entity,Migrations,Tests,Osinet}'
  18. # controllers are imported separately to make sure services can be injected
  19. # as action arguments even if you don't extend any base controller class
  20. App\Controller\:
  21. resource: '../src/Controller'
  22. tags: ['controller.service_arguments']
  23. # add more service definitions when explicit configuration is needed
  24. # please note that last definitions always *replace* previous ones
  25. App\Controller\LuckyController:
  26. public: true
  27. bind:
  28. $logger: '@app.logger'
  29. app.logger:
  30. class: App\Logger