-
Notifications
You must be signed in to change notification settings - Fork 54
/
services.yaml
73 lines (62 loc) · 3.46 KB
/
services.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# 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:
app.config: '%env(json:file:APPLICATION_CONFIG)%'
env(DATABASE_NAME): '%env(string:key:DATABASE_NAME:json:file:APPLICATION_CONFIG)%'
env(DATABASE_URL): '%env(string:key:DATABASE_URL:json:file:APPLICATION_CONFIG)%'
env(JWT_PASSPHRASE): '%env(string:key:JWT_PASSPHRASE:json:file:APPLICATION_CONFIG)%'
env(JWT_PRIVATE_KEY_PATH): '%env(string:key:JWT_SECRET_KEY:json:file:APPLICATION_CONFIG)%'
env(JWT_PUBLIC_KEY_PATH): '%env(string:key:JWT_PUBLIC_KEY:json:file:APPLICATION_CONFIG)%'
env(CORS_ALLOW_ORIGIN): '%env(string:key:CORS_ALLOW_ORIGIN:json:file:APPLICATION_CONFIG)%'
locale: 'en'
app.uuid_regex: '^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-1[0-9a-fA-F]{3}\-[89ab][0-9a-f]{3}\-[0-9a-fA-F]{12}$'
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:
$projectDir: '%kernel.project_dir%'
$environment: '%kernel.environment%'
$uuidRegex: '%app.uuid_regex%'
$locale: '%locale%'
_instanceof:
App\Rest\Interfaces\ControllerInterface:
tags: [ 'app.rest.controller' ]
App\Rest\Interfaces\RestResourceInterface:
tags: [ 'app.rest.resource' ]
# 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,Entity,EventListener,Migrations,Tests,Kernel.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/Controller'
tags: [ 'controller.service_arguments' ]
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\DataFixtures\:
resource: '../src/DataFixtures/*'
tags: [ 'doctrine.fixture.orm' ]
App\ArgumentResolver\EntityValueResolver:
tags:
- { name: controller.argument_value_resolver, priority: 150 }
App\Utils\RequestLogger:
arguments:
$sensitiveProperties: '%env(key:REQUEST_LOG_SENSITIVE_PROPERTIES:json:file:APPLICATION_CONFIG)%'
App\Resource\ResourceCollection:
arguments: [ !tagged app.rest.resource ]
App\Rest\ControllerCollection:
arguments: [ !tagged app.rest.controller ]
App\Security\RolesService:
arguments: [ '%security.role_hierarchy.roles%' ]
App\EventSubscriber\BlameableDecorator:
class: App\EventSubscriber\BlameableDecorator
decorates: stof_doctrine_extensions.listener.blameable