forked from EC-CUBE/ec-cube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.yaml
205 lines (164 loc) · 7.18 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# 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:
# container parameters
container.dumper.inline_class_loader: true
# ec-cube parameters
env(ECCUBE_LOCALE): 'ja'
env(ECCUBE_TIMEZONE): 'Asia/Tokyo'
env(ECCUBE_CURRENCY): 'JPY'
locale: '%env(ECCUBE_LOCALE)%'
timezone: '%env(ECCUBE_TIMEZONE)%'
currency: '%env(ECCUBE_CURRENCY)%'
services:
# default configuration for services in *this* file
_defaults:
# automatically injects dependencies in your services
autowire: true
# automatically registers your services as commands, event subscribers, etc.
autoconfigure: true
# this means you cannot fetch services directly from the container via $container->get()
# if you need to do this, you can override this setting on individual services
public: false
bind:
$cartPurchaseFlow: '@eccube.purchase.flow.cart'
$shoppingPurchaseFlow: '@eccube.purchase.flow.shopping'
$orderPurchaseFlow: '@eccube.purchase.flow.order'
$_orderStateMachine: '@state_machine.order'
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Eccube\:
resource: '../../../src/Eccube/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
exclude: '../../../src/Eccube/{Annotation,Common,Entity,Exception,Log,Plugin,ServiceProvider,Resource,Doctrine/ORM/tools/}'
Eccube\Common\EccubeConfig:
public: true
Eccube\Service\TaxRuleService:
lazy: true
public: true
Eccube\Repository\TaxRuleRepository:
lazy: true
Eccube\Service\CartService:
lazy: true
Eccube\Service\SystemService:
lazy: true
public: true
Eccube\Service\Composer\ComposerProcessService:
lazy: true
Eccube\Service\Composer\ComposerServiceInterface:
factory: ['Eccube\Service\Composer\ComposerServiceFactory', createService]
Eccube\Service\Composer\ComposerApiService:
lazy: true
public: true
Eccube\Repository\PluginRepository:
lazy: true
public: true
Eccube\Service\PluginService:
lazy: true
public: true
# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
Eccube\Controller\:
resource: '../../../src/Eccube/Controller'
tags: ['controller.service_arguments']
Eccube\Twig\Extension\EccubeBlockExtension:
tags: ['twig.extension']
bind:
$blockTemplates: '%eccube_twig_block_templates%'
Plugin\:
resource: '../../../app/Plugin/*'
exclude: '../../../app/Plugin/*/{Entity,Resource,ServiceProvider,Tests,Codeception,DoctrineMigrations}'
Customize\:
resource: '../../../app/Customize/*'
exclude: '../../../app/Customize/{Entity,Resource,Tests}'
Customize\Controller\:
resource: '../../../app/Customize/Controller'
tags: ['controller.service_arguments']
twig.extension.stringloader:
class: Twig_Extension_StringLoader
tags: ['twig.extension']
eccube.collector.core:
class: Eccube\DataCollector\EccubeDataCollector
tags:
- { name: 'data_collector', template: '@toolbar/eccube.html.twig', id: 'eccube_core', priority: -512 }
eccube.security.success_handler:
class: Eccube\Security\Http\Authentication\EccubeAuthenticationSuccessHandler
eccube.security.failure_handler:
class: Eccube\Security\Http\Authentication\EccubeAuthenticationFailureHandler
# Autowiring can't guess the constructor arguments that are not type-hinted with
# classes (e.g. container parameters) so you must define those arguments explicitly
# Eccube\Command\ListUsersCommand:
# $emailSender: '%app.notifications.email_sender%'
# when the service definition only contains arguments, you can omit the
# 'arguments' key and define the arguments just below the service class
# Eccube\Twig\AppExtension:
# $locales: '%app_locales%'
# Eccube\EventSubscriber\CommentNotificationSubscriber:
# $sender: '%app.notifications.email_sender%'
# Eccube\EventSubscriber\RedirectToPreferredLocaleSubscriber:
# $locales: '%app_locales%'
# $defaultLocale: '%locale%'
# needed for the 'localizeddate' Twig filter
# Twig\Extensions\IntlExtension: ~
eccube.logger:
class: Eccube\Log\Logger
arguments:
- '@Eccube\Request\Context'
- '@monolog.logger'
- '@monolog.logger.front'
- '@monolog.logger.admin'
lazy: true
public: true
eccube.log.formatter.line:
class: Monolog\Formatter\LineFormatter
arguments:
- "[%%datetime%%] %%channel%%.%%level_name%% [%%extra.session_id%%] [%%extra.uid%%] [%%extra.user_id%%] [%%extra.class%%:%%extra.function%%:%%extra.line%%] - %%message%% %%context%% [%%extra.http_method%%, %%extra.url%%, %%extra.ip%%, %%extra.referrer%%, %%extra.user_agent%%]\n"
Eccube\Log\Processor\SessionProcessor:
tags:
- { name: monolog.processor }
Eccube\Log\Processor\TokenProcessor:
tags:
- { name: monolog.processor }
Monolog\Processor\UidProcessor:
tags:
- { name: monolog.processor }
Monolog\Processor\IntrospectionProcessor:
arguments:
- '!php/const:Monolog\Logger::DEBUG'
- ['Eccube\\Log', 'Psr\\Log']
tags:
- { name: monolog.processor }
Symfony\Bridge\Monolog\Processor\WebProcessor:
arguments:
- url: REQUEST_URI
ip: REMOTE_ADDR
http_method: REQUEST_METHOD
server: SERVER_NAME
referrer: HTTP_REFERER
# add user aegnt
user_agent: HTTP_USER_AGENT
tags:
- { name: monolog.processor }
- { name: kernel.event_listener, event: kernel.request, priority: 1024 }
Symfony\Component\HttpFoundation\ParameterBag:
# APP_ENV=prod時にtwigテンプレート内のroutingでシステムエラーになるのを抑止.
Eccube\Twig\Extension\IgnoreRoutingNotFoundExtension:
decorates: 'twig.extension.routing'
# Symfony\Bridge\Twig\Extension\RoutingExtensionの後に登録するため,
# autoconfigureはfalseにし, CompilerPassで追加する.
autoconfigure: false
native_file_session_handler:
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler
arguments:
- '%session.save_path%'
Eccube\Session\Storage\Handler\SameSiteNoneCompatSessionHandler:
arguments:
- '@native_file_session_handler'
Eccube\DependencyInjection\Facade\AnnotationReaderFacade:
public: true
SunCat\MobileDetectBundle\DeviceDetector\MobileDetector:
tags:
- { name: mobile_detect.mobile_detector.default }
- { name: mobile_detect.mobile_detector }
public: true