services.yaml 13.4 KB
Newer Older
1
2
3
4
5
6
7
# 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.version: 2.5.8
8
    use_as_sass: "%env(USE_AS_SAAS)%"
9
    locale: fr
10
11
    router.request_context.host: '%env(string:BASE_URL)%'
    router.request_context.base_url: '%env(BASE_PATH)%'
12
    from_email: "%env(FROM_EMAIL)%"
Sebastian Castro's avatar
Sebastian Castro committed
13
    use_as_saas: '%env(bool:USE_AS_SAAS)%'
14
15
    images_max_filesize: "%env(IMAGES_MAX_FILESIZE)%"
    files_max_filesize: "%env(FILES_MAX_FILESIZE)%"
16
    base_protocol: '%env(BASE_PROTOCOL)%'
17
18
19
20
    base_path: '%env(BASE_PATH)%'
    base_url: '%env(BASE_URL)%'
    instance_name: '%env(INSTANCE_NAME)%'
    contact_email: '%env(CONTACT_EMAIL)%'
21
22
23
24
25
26

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.
27
        public: false
28
29
30
31
32
33
34
35
36
37
38
39
    # 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,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']

40
41
42
43
    # ----- GOGO SERVICES ------

    App\Services\UploadDirectoryNamer:
      class: App\Services\UploadDirectoryNamer
44
      public: true
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
      arguments: []

    App\Services\GoGoCartoJsService:
      arguments:
        $baseProtocol: '%base_protocol%'

    App\Services\AsyncService:
      arguments:
        $rootDir: '%kernel.root_dir%'
        $env: '%kernel.environment%'

    App\Services\WebhookService:
      arguments:
        $baseUrl: '%base_url%'
        $basePath: '%base_path%'

61
    App\Services\MailService:
62
63
64
65
66
67
      arguments:
        $basePath: '%base_path%'
        $baseUrl: '%base_url%'
        $saas: '%use_as_saas%'
        $instanceName: '%instance_name%'
        $fromEmail: '%from_email%'
Sebastian Castro's avatar
Sebastian Castro committed
68

69
70
71
72
73
74
    App\Application\Sonata\UserBundle\Form\Type\RegistrationFormType:
      arguments: [ "%fos_user.model.user.class%" ]
      tags:
        - { name: "form.type", alias: "gogo_user_registration"}

    App\Application\Sonata\UserBundle\Security\FOSUBUserProvider:
Sebastian Castro's avatar
Sebastian Castro committed
75
76
      arguments:
        - "@fos_user.user_manager"
77
        - { facebook: facebookUid, gplus: gplusUid, communs: communsUid }
Sebastian Castro's avatar
Sebastian Castro committed
78
79
80

    # --------- EVENT LISTENERS -----------

81
    App\EventListener\ImageResizer:
82
83
84
85
86
      arguments:
          - '%env(IMAGE_RESIZE_WIDTH)%'
      tags:
          - { name: doctrine_mongodb.odm.event_listener, event: postPersist }

87
    App\EventListener\ConfigurationListener:
88
89
90
      tags:
          - { name: doctrine_mongodb.odm.event_listener, event: preUpdate }

91
    App\EventListener\ElementJsonGenerator:
92
93
94
      tags:
          - { name: doctrine_mongodb.odm.event_listener, event: preFlush }

95
    App\EventListener\TaxonomyJsonGenerator:
96
97
98
99
100
101
      tags:
          - { name: doctrine_mongodb.odm.event_listener, event: postPersist }
          - { name: doctrine_mongodb.odm.event_listener, event: postFlush }
          - { name: doctrine_mongodb.odm.event_listener, event: preFlush }
          - { name: doctrine_mongodb.odm.event_listener, event: postUpdate }

102
    App\EventListener\DatabaseIntegrityWatcher:
103
104
105
106
107
108
      tags:
          - { name: doctrine_mongodb.odm.event_listener, event: preRemove }
          - { name: doctrine_mongodb.odm.event_listener, event: preFlush }
          - { name: doctrine_mongodb.odm.event_listener, event: preUpdate }


Sebastian Castro's avatar
Sebastian Castro committed
109
110
    # ----------- SONATA BLOCKS -------------

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    gogo.block.service.monitoring:
        class: App\Block\MonitoringElementsBlockService
        arguments: [ "@twig", "@doctrine.odm.mongodb.document_manager" ]
        tags:
            - { name: sonata.block }

    gogo.block.service.charts:
        class: App\Block\ChartBlockService
        arguments: [ "@twig", "@doctrine.odm.mongodb.document_manager", "App/Services/ConfigurationService" ]
        tags:
            - { name: sonata.block }

    gogo.block.recent_elements:
        class: App\Block\RecentElementsBlockService
        arguments: [ "@twig", "@doctrine.odm.mongodb.document_manager", "@sonata.admin.pool" ]
        tags:
Sebastian Castro's avatar
Sebastian Castro committed
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
            - { name: sonata.block }

    # ----------------------------------------
    # ------------- SONATA ADMIN -------------
    # ----------------------------------------


    # --------- CONTENTS -----------

    admin.wrappers:
        class: App\Admin\WrapperAdmin
        arguments: [~, App\Document\Wrapper, 'PixSortableBehaviorBundle:SortableAdmin']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Contenus", label: Bandeaux de la page d'accueil }

    admin.partners:
        class: App\Admin\PartnerAdmin
        arguments: [~, App\Document\Partner, 'PixSortableBehaviorBundle:SortableAdmin']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Contenus", label: Partenaires }

    admin.abouts_popup:
        class: App\Admin\AboutAdmin
        arguments: [~, App\Document\About, 'PixSortableBehaviorBundle:SortableAdmin']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Contenus", label: Popups type "A propos" }


    # --------- CONFIGURATION -----------

    admin.general_config:
        class: App\Admin\ConfigurationAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: Configuration Générale }

    admin.style_config:
        class: App\Admin\ConfigurationStyleAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: Style / Couleurs / Icones }

    admin.home_config:
        class: App\Admin\ConfigurationHomeAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: Page d'Accueil }

    admin.map_config:
        class: App\Admin\ConfigurationMapAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: La Carte }

    admin.tile_layers:
        class: App\Admin\TileLayerAdmin
        arguments: [~, App\Document\TileLayer, 'PixSortableBehaviorBundle:SortableAdmin']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: Fonds de Carte }

    admin.fiche_detail_config:
        class: App\Admin\ConfigurationInfoBarAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: data_model, label: Fiche Détail }

    admin.marker_config:
        class: App\Admin\ConfigurationMarkerAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: custom, label: Marqueur / Popup }

    admin.contributions_config:
        class: App\Admin\ConfigurationContributionsAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: data_model, label: Qui peut Contribuer? }

    admin.form_config:
        class: App\Admin\ConfigurationFormAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: data_model, label: Formulaire }

    admin.email_config:
        class: App\Admin\ConfigurationMailAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: emailing, label: Mails / Newsletter }

    admin.api_config:
        class: App\Admin\ConfigurationAPIAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: other_config, label: APIs }

    # -- USER CONF ---

    admin.login_config:
        class: App\Admin\ConfigurationUserAdmin
        arguments: [~, App\Document\Configuration, 'App\Controller\Admin\ConfigurationAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: sonata_user, label: Configuration }

    admin.etiquettes_config:
        class: App\Admin\StampAdmin
        arguments: [~, App\Document\Stamp, '' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: other_config, label: Etiquettes }

    admin.webhooks_config:
        class: App\Admin\WebhookAdmin
        arguments: [~, App\Document\Webhook, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: other_config, label: Webhooks }


    # --------- HIDDEN -----------

    admin.parter_image_hidden:
        class: App\Admin\ImageAdmin
        arguments: [~, App\Document\PartnerImage, '' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.conf_image_hidden:
        class: App\Admin\ImageAdmin
        arguments: [~, App\Document\ConfImage, '' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.image_hidden:
        class: App\Admin\ImageAdmin
        arguments: [~, App\Document\EmbeddedImage, '' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.feature_config_hidden:
        class: App\Admin\FeatureConfigurationAdmin
        arguments: [~, App\Document\FeatureConfiguration, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.interaction_config_hidden:
        class: App\Admin\InteractionConfigurationAdmin
        arguments: [~, App\Document\InteractionConfiguration, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.automated_mail_config_hidden:
        class: App\Admin\AutomatedMailConfigurationAdmin
        arguments: [~, App\Document\AutomatedMailConfiguration, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    # ------- ELEMENTS ----------

    admin.elements:
        class: App\Admin\Element\ElementAdmin
        arguments: [~, App\Document\Element, 'App\Controller\Admin\ElementAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "data", label: Éléments }

    admin.categories:
        class: App\Admin\CategoryAdmin
        arguments: [~, App\Document\Category, 'App\Controller\Admin\CategoryAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: data_model, label: Catégories }

    admin.imports:
        class: App\Admin\ImportAdmin
        arguments: [~, App\Document\Import, 'App\Controller\Admin\ImportAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "data", label: Import }

    admin.dynamic_imports:
        class: App\Admin\ImportAdmin
        arguments: [~, App\Document\ImportDynamic, 'App\Controller\Admin\ImportAdminController' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "data", label: Import dynamique }

    admin.element_image_hidden:
        class: App\Admin\ImageAdmin
        arguments: [~, App\Document\ElementImage, '' ]
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.option_hidden:
        class: App\Admin\OptionAdmin
        arguments: [~, App\Document\Option, 'App\Controller\Admin\OptionAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.option.lite_hidden:
        class: App\Admin\OptionLiteAdmin
        arguments: [~, App\Document\Option, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    admin.categories.lite_hidden:
        class: App\Admin\CategoryLiteAdmin
        arguments: [~, App\Document\Category, '']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "Hide" }

    # ------- SAAS ---------

    admin.project:
        class: App\Admin\ProjectAdmin
        arguments: [~, App\Document\Project, 'App\Controller\Admin\ProjectAdminController']
        tags:
            - { name: sonata.admin, manager_type: doctrine_mongodb, group: "hide", label: Projets }