Improved structure of services.yaml

This commit is contained in:
Jan Böhmer 2020-05-12 23:05:59 +02:00
parent decc4e90fc
commit e836a9d036

View file

@ -33,12 +33,20 @@ services:
resource: '../src/Controller' resource: '../src/Controller'
tags: ['controller.service_arguments'] tags: ['controller.service_arguments']
####################################################################################################################
# Email
####################################################################################################################
App\EventSubscriber\SetMailFromSubscriber: App\EventSubscriber\SetMailFromSubscriber:
tags: ['kernel.event_subscriber'] tags: ['kernel.event_subscriber']
arguments: arguments:
$email: '%partdb.mail.sender_email%' $email: '%partdb.mail.sender_email%'
$name: '%partdb.mail.sender_name%' $name: '%partdb.mail.sender_name%'
####################################################################################################################
# Log System
####################################################################################################################
App\Services\LogSystem\EventLogger: App\Services\LogSystem\EventLogger:
arguments: arguments:
# By default only log events which has minimum info level (debug levels are not logged) # By default only log events which has minimum info level (debug levels are not logged)
@ -49,17 +57,6 @@ services:
# Only the event classes specified here are saved to DB (set to []) to log all events # Only the event classes specified here are saved to DB (set to []) to log all events
$whitelist: [] $whitelist: []
Liip\ImagineBundle\Service\FilterService:
alias: 'liip_imagine.service.filter'
app.doctrine.elementListener:
class: App\Security\EntityListeners\ElementPermissionListener
public: false
autowire: true
tags:
- { name: "doctrine.orm.entity_listener" }
App\EventSubscriber\LogSystem\EventLoggerSubscriber: App\EventSubscriber\LogSystem\EventLoggerSubscriber:
arguments: arguments:
$save_changed_fields: '%env(bool:HISTORY_SAVE_CHANGED_FIELDS)%' $save_changed_fields: '%env(bool:HISTORY_SAVE_CHANGED_FIELDS)%'
@ -72,28 +69,57 @@ services:
tags: tags:
- { name: 'doctrine.event_subscriber' } - { name: 'doctrine.event_subscriber' }
App\Form\AttachmentFormType:
arguments:
$allow_attachments_downloads: '%partdb.attachments.allow_downloads%'
tree_invalidation_listener: App\Services\Attachments\AttachmentSubmitHandler:
class: App\EntityListeners\TreeCacheInvalidationListener arguments:
tags: $allow_attachments_downloads: '%partdb.attachments.allow_downloads%'
- { name: doctrine.orm.entity_listener } $mimeTypes: '@mime_types'
attachment_delete_listener: ####################################################################################################################
class: App\EntityListeners\AttachmentDeleteListener # Attachment system
####################################################################################################################
Liip\ImagineBundle\Service\FilterService:
alias: 'liip_imagine.service.filter'
App\EntityListeners\AttachmentDeleteListener:
tags: tags:
- name: doctrine.orm.entity_listener - name: doctrine.orm.entity_listener
# Dont use JSONSerializable Interface, App\Services\Attachments\AttachmentPathResolver:
serializer.normalizer.json_serializable:
class: Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
tags:
- {name: serializer.normalizer, priority: -9000}
App\Controller\RedirectController:
arguments: arguments:
$default_locale: '%partdb.locale%' $project_dir: '%kernel.project_dir%'
$enforce_index_php: '%env(bool:NO_URL_REWRITE_AVAILABLE)%' $media_path: '%partdb.attachments.dir.media%'
$secure_path: '%partdb.attachments.dir.secure%'
$footprints_path: 'public/img/footprints'
$models_path: null
App\Services\Attachments\FileTypeFilterTools:
arguments:
$mimeTypes: '@mime_types'
####################################################################################################################
# Security
####################################################################################################################
App\Security\EntityListeners\ElementPermissionListener:
tags:
- { name: "doctrine.orm.entity_listener" }
####################################################################################################################
# Cache
####################################################################################################################
App\EntityListeners\TreeCacheInvalidationListener:
tags:
- { name: doctrine.orm.entity_listener }
####################################################################################################################
# Price system
####################################################################################################################
App\Command\UpdateExchangeRatesCommand: App\Command\UpdateExchangeRatesCommand:
arguments: arguments:
$base_current: '%partdb.default_currency%' $base_current: '%partdb.default_currency%'
@ -110,15 +136,9 @@ services:
arguments: arguments:
$base_currency: '%partdb.default_currency%' $base_currency: '%partdb.default_currency%'
App\Form\AttachmentFormType: ###################################################################################################################
arguments: # User system
$allow_attachments_downloads: '%partdb.attachments.allow_downloads%' ####################################################################################################################
App\Services\Attachments\AttachmentSubmitHandler:
arguments:
$allow_attachments_downloads: '%partdb.attachments.allow_downloads%'
$mimeTypes: '@mime_types'
App\Form\UserSettingsType: App\Form\UserSettingsType:
arguments: arguments:
$demo_mode: '%partdb.demo_mode%' $demo_mode: '%partdb.demo_mode%'
@ -131,32 +151,43 @@ services:
arguments: arguments:
$allow_email_pw_reset: '%partdb.users.email_pw_reset%' $allow_email_pw_reset: '%partdb.users.email_pw_reset%'
App\Services\Attachments\AttachmentPathResolver:
arguments:
$project_dir: '%kernel.project_dir%'
$media_path: '%partdb.attachments.dir.media%'
$secure_path: '%partdb.attachments.dir.secure%'
$footprints_path: 'public/img/footprints'
$models_path: null
App\Services\Attachments\FileTypeFilterTools:
arguments:
$mimeTypes: '@mime_types'
App\Services\TFA\BackupCodeGenerator: App\Services\TFA\BackupCodeGenerator:
arguments: arguments:
$code_length: 8 $code_length: 8
$code_count: 15 $code_count: 15
App\Services\LabelSystem\LabelTextReplacer:
arguments:
$providers: !tagged_iterator 'app.label_placeholder_provider'
App\Services\TranslationExtractor\PermissionExtractor: App\Services\TranslationExtractor\PermissionExtractor:
tags: tags:
- { name: 'translation.extractor', alias: 'permissionExtractor'} - { name: 'translation.extractor', alias: 'permissionExtractor'}
####################################################################################################################
# Label system
####################################################################################################################
App\Services\LabelSystem\LabelTextReplacer:
arguments:
$providers: !tagged_iterator 'app.label_placeholder_provider'
# PartLotProvider must be invoked before all other providers, so it can override %%NAME%% placeholder # PartLotProvider must be invoked before all other providers, so it can override %%NAME%% placeholder
App\Services\LabelSystem\PlaceholderProviders\PartLotProvider: App\Services\LabelSystem\PlaceholderProviders\PartLotProvider:
tags: tags:
- { name: 'app.label_placeholder_provider', priority: 10} - { name: 'app.label_placeholder_provider', priority: 10}
####################################################################################################################
# Symfony overrides
####################################################################################################################
# Dont use JSONSerializable Interface,
serializer.normalizer.json_serializable:
class: Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
tags:
- {name: serializer.normalizer, priority: -9000}
####################################################################################################################
# Miscellaneous
####################################################################################################################
App\Controller\RedirectController:
arguments:
$default_locale: '%partdb.locale%'
$enforce_index_php: '%env(bool:NO_URL_REWRITE_AVAILABLE)%'