-
Notifications
You must be signed in to change notification settings - Fork 15
/
services.yaml
117 lines (95 loc) · 5.37 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
# 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.allowed_locales: [ 'de_DE', 'en_GB' ]
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.
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
WMDE\Fundraising\Frontend\App\Controllers\:
resource: '../app/Controllers/*'
tags: ['controller.service_arguments']
# register kernel event subscribers
WMDE\Fundraising\Frontend\App\EventHandlers\:
resource: '../app/EventHandlers/*'
exclude: '../app/EventHandlers/{LogErrors}.php'
# register console commands
WMDE\Fundraising\Frontend\Cli\:
resource: '../cli/*'
WMDE\Fundraising\PaymentContext\Commands\:
resource: '../vendor/wmde/fundraising-payments/src/Commands/*'
# In the future, me might get less and less reliant on FunFunFactory and make
# classes in src/ available to be used as services
# The following configuration creates a service per class whose id is the fully-qualified class name
# WMDE\Fundraising\Frontend\:
# resource: '../src/*'
# exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
# add more service definitions as long the the above statement is commented out or
# when explicit configuration is needed.
# please note that last definitions always *replace* previous ones
# Inject the log path and route into the PayPal IPN Logger
WMDE\Fundraising\Frontend\App\EventHandlers\PayPalRequestLogger:
class: WMDE\Fundraising\Frontend\App\EventHandlers\PayPalRequestLogger
public: true
arguments:
- "%kernel.logs_dir%/paypal_ipn_log.csv"
- ["handle_paypal_payment_notification", "handle_paypal_membership_fee_payments"]
- "@logger"
WMDE\Fundraising\Frontend\App\EventHandlers\StoreLocale:
class: WMDE\Fundraising\Frontend\App\EventHandlers\StoreLocale
public: true
arguments:
- '@WMDE\Fundraising\Frontend\Factories\FunFunFactory'
- "%app.allowed_locales%"
# Inject the allowed routes and url parameter into the Banner Tracker
WMDE\Fundraising\Frontend\App\EventHandlers\TrackBannerDonationRedirects:
class: WMDE\Fundraising\Frontend\App\EventHandlers\TrackBannerDonationRedirects
public: true
arguments:
- "add_donation"
- "show_donation_confirmation"
- "banner_submission"
# We need the bootstrapper to be public to be able to access it in tests
WMDE\Fundraising\Frontend\Infrastructure\EnvironmentBootstrapper:
class: WMDE\Fundraising\Frontend\Infrastructure\EnvironmentBootstrapper
public: true
arguments:
- "%env(resolve:APP_ENV)%"
# We need the FunFunFactory to be public to be able to access it in tests
WMDE\Fundraising\Frontend\Factories\FunFunFactory:
class: WMDE\Fundraising\Frontend\Factories\FunFunFactory
factory: ['@WMDE\Fundraising\Frontend\Infrastructure\EnvironmentBootstrapper', 'newFunFunFactory']
public: true
calls:
- setUrlGenerator: ["@app.url_generator"]
- setMailer: ["@mailer"]
WMDE\Fundraising\Frontend\App\UrlGeneratorAdapter:
class: WMDE\Fundraising\Frontend\App\UrlGeneratorAdapter
app.url_generator:
alias: WMDE\Fundraising\Frontend\App\UrlGeneratorAdapter
public: true
WMDE\Fundraising\Frontend\Infrastructure\EventHandling\DomainEventHandler\BucketLoggingHandler:
class: WMDE\Fundraising\Frontend\Infrastructure\EventHandling\DomainEventHandler\BucketLoggingHandler
factory: ['@WMDE\Fundraising\Frontend\Factories\FunFunFactory', 'getBucketLoggingHandler']
app.errbit_logger:
class: Airbrake\MonologHandler
factory: ['WMDE\Fundraising\Frontend\Factories\ErrbitLoggerFactory', 'createErrbitHandler']
arguments:
- "%env(resolve:ERRBIT_PROJECT_ID)%"
- "%env(resolve:ERRBIT_PROJECT_KEY)%"
- "%env(resolve:ERRBIT_HOST)%"
- "%env(resolve:APP_ENV)%"
# We can't define the log level in the monolog configuration, see https://github.com/symfony/monolog-bundle/issues/322
- notice
WMDE\Fundraising\PaymentContext\Services\PayPal\GuzzlePaypalAPI:
class: WMDE\Fundraising\PaymentContext\Services\PayPal\GuzzlePaypalAPI
factory: ['@WMDE\Fundraising\Frontend\Factories\FunFunFactory', 'getPayPalApiClient']
WMDE\Fundraising\PaymentContext\Services\PayPal\PaypalAPI: '@WMDE\Fundraising\PaymentContext\Services\PayPal\GuzzlePaypalAPI'