Advertisement
Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  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. locale: 'en'
  5.  
  6. services:
  7. # default configuration for services in *this* file
  8. _defaults:
  9. autowire: true # Automatically injects dependencies in your services.
  10. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
  11. public: false # Allows optimizing the container by removing unused services; this also means
  12. # fetching services directly from the container via $container->get() won't work.
  13. # The best practice is to be explicit about your dependencies anyway.
  14.  
  15. # makes classes in src/ available to be used as services
  16. # this creates a service per class whose id is the fully-qualified class name
  17. App:
  18. resource: '../src/*'
  19. exclude: '../src/{Commands,Migrations,Tests,Kernel.php}'
  20.  
  21. # controllers are imported separately to make sure services can be injected
  22. # as action arguments even if you don't extend any base controller class
  23. AppController:
  24. resource: '../src/Controller'
  25. tags: ['controller.service_arguments']
  26.  
  27. /** **/
  28.  
  29. app.current_user_factory:
  30. class: AppSecurityAuthenticationCurrentUserFactory
  31. arguments: ['@security.token_storage']
  32.  
  33. app.current_user:
  34. class: AppEntityUser
  35. factory: ['@app.current_user_factory', getUser]
  36.  
  37. imports:
  38. - { resource: 'handlers.yml' }
  39. - { resource: 'repos.yml' }
  40. - { resource: 'controllers.yml' }
  41.  
  42. AppSecurityAuthenticationCurrentUserFactory:
  43. arguments: ['@security.token_storage']
  44.  
  45. AppEntityUser:
  46. factory: 'AppSecurityAuthenticationCurrentUserFactory:getUser'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement