2019-02-23 16:49:38 +01:00
# 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
2019-03-12 13:34:33 +01:00
2022-03-04 19:11:09 +01:00
imports :
- { resource : parameters.yaml }
2019-02-23 16:49:38 +01:00
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.
2019-12-31 18:12:15 +01:00
bind :
2020-05-12 22:53:42 +02:00
bool $demo_mode : '%partdb.demo_mode%'
2023-06-11 14:50:47 +02:00
bool $gdpr_compliance : '%partdb.gdpr_compliance%'
bool $kernel_debug_enabled : '%kernel.debug%'
2020-03-29 23:36:53 +02:00
string $kernel_cache_dir : '%kernel.cache_dir%'
2020-05-12 22:53:42 +02:00
string $partdb_title : '%partdb.title%'
2023-06-11 14:50:47 +02:00
string $base_currency : '%partdb.default_currency%'
2020-04-14 17:21:30 +02:00
_instanceof :
App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface :
tags : [ 'app.label_placeholder_provider' ]
2019-02-23 16:49:38 +01:00
2023-07-09 14:27:41 +02:00
App\Services\InfoProviderSystem\Providers\InfoProviderInterface :
tags : [ 'app.info_provider' ]
2019-02-23 16:49:38 +01:00
# 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\ :
2022-03-04 19:11:09 +01:00
resource : '../src/'
exclude :
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
2019-02-23 16:49:38 +01:00
# 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' ]
2020-06-07 22:46:32 +02:00
####################################################################################################################
# Alias definitions
####################################################################################################################
Swap\Swap :
alias : 'florianv_swap.swap'
2020-07-04 23:38:18 +02:00
Doctrine\Migrations\DependencyFactory :
alias : 'doctrine.migrations.dependency_factory'
2021-10-02 20:14:48 +02:00
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Email
####################################################################################################################
2020-04-09 17:24:16 +02:00
App\EventSubscriber\SetMailFromSubscriber :
2019-11-24 22:49:22 +01:00
tags : [ 'kernel.event_subscriber' ]
arguments :
2020-05-12 22:53:42 +02:00
$email : '%partdb.mail.sender_email%'
$name : '%partdb.mail.sender_name%'
2019-11-24 22:49:22 +01:00
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Log System
####################################################################################################################
2020-01-26 13:59:30 +01:00
App\Services\LogSystem\EventLogger :
arguments :
# By default only log events which has minimum info level (debug levels are not logged)
# 7 is lowest level (debug), 0 highest (emergency
$minimum_log_level : 6
# Event classes specified here are not saved to DB
$blacklist : [ ]
# Only the event classes specified here are saved to DB (set to []) to log all events
$whitelist : [ ]
2024-06-21 23:41:22 +02:00
App\EventListener\LogSystem\EventLoggerListener :
2020-02-23 21:04:16 +01:00
arguments :
$save_changed_fields : '%env(bool:HISTORY_SAVE_CHANGED_FIELDS)%'
$save_changed_data : '%env(bool:HISTORY_SAVE_CHANGED_DATA)%'
$save_removed_data : '%env(bool:HISTORY_SAVE_REMOVED_DATA)%'
2023-05-14 21:41:00 +02:00
$save_new_data : '%env(bool:HISTORY_SAVE_NEW_DATA)%'
2020-01-26 21:31:48 +01:00
2020-05-12 23:05:59 +02:00
App\Form\AttachmentFormType :
arguments :
2023-06-11 14:50:47 +02:00
$allow_attachments_download : '%partdb.attachments.allow_downloads%'
2023-03-02 23:08:14 +01:00
$max_file_size : '%partdb.attachments.max_file_size%'
2023-11-26 23:44:02 +01:00
$download_by_default : '%partdb.attachments.download_by_default%'
2020-01-26 21:31:48 +01:00
2020-05-12 23:05:59 +02:00
App\Services\Attachments\AttachmentSubmitHandler :
arguments :
$allow_attachments_downloads : '%partdb.attachments.allow_downloads%'
$mimeTypes : '@mime_types'
2023-03-02 23:38:23 +01:00
$max_upload_size : '%partdb.attachments.max_file_size%'
2019-08-20 12:34:43 +02:00
2023-04-08 20:43:19 +02:00
App\Services\LogSystem\EventCommentNeededHelper :
arguments :
$enforce_change_comments_for : '%partdb.enforce_change_comments_for%'
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Attachment system
####################################################################################################################
Liip\ImagineBundle\Service\FilterService :
alias : 'liip_imagine.service.filter'
App\EntityListeners\AttachmentDeleteListener :
2019-08-27 22:24:56 +02:00
tags :
- name : doctrine.orm.entity_listener
2020-05-12 23:05:59 +02:00
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
2019-08-20 12:34:43 +02:00
2020-05-12 23:05:59 +02:00
App\Services\Attachments\FileTypeFilterTools :
2019-09-12 17:50:33 +02:00
arguments :
2020-05-12 23:05:59 +02:00
$mimeTypes : '@mime_types'
####################################################################################################################
# Security
####################################################################################################################
2023-02-20 23:04:20 +01:00
saml_user_factory :
2023-02-27 23:47:42 +01:00
alias : App\Security\SamlUserFactory
public : true
App\Security\SamlUserFactory :
arguments :
$saml_role_mapping : '%env(json:SAML_ROLE_MAPPING)%'
$update_group_on_login : '%env(bool:SAML_UPDATE_GROUP_ON_LOGIN)%'
2023-02-20 23:04:20 +01:00
2023-10-09 00:13:56 +02:00
security.access_token_extractor.header.token :
class : Symfony\Component\Security\Http\AccessToken\HeaderAccessTokenExtractor
arguments :
$tokenType : 'Token'
security.access_token_extractor.main :
class : Symfony\Component\Security\Http\AccessToken\ChainAccessTokenExtractor
arguments :
$accessTokenExtractors :
- '@security.access_token_extractor.header'
- '@security.access_token_extractor.header.token'
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Cache
####################################################################################################################
App\EntityListeners\TreeCacheInvalidationListener :
tags :
- { name : doctrine.orm.entity_listener }
2019-09-12 17:50:33 +02:00
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Price system
####################################################################################################################
2022-08-04 21:49:16 +02:00
App\Command\Currencies\UpdateExchangeRatesCommand :
2019-08-13 13:04:31 +02:00
arguments :
2020-05-12 22:53:42 +02:00
$base_current : '%partdb.default_currency%'
2019-08-13 13:04:31 +02:00
2019-08-30 14:25:05 +02:00
App\Form\Type\CurrencyEntityType :
arguments :
2020-05-12 22:53:42 +02:00
$base_currency : '%partdb.default_currency%'
2019-08-30 14:25:05 +02:00
2022-12-18 17:28:42 +01:00
App\Services\Parts\PricedetailHelper :
2019-09-01 14:37:53 +02:00
arguments :
2020-05-12 22:53:42 +02:00
$base_currency : '%partdb.default_currency%'
2019-09-01 14:37:53 +02:00
2022-12-18 17:28:42 +01:00
App\Services\Formatters\MoneyFormatter :
2019-10-19 17:13:13 +02:00
arguments :
2020-05-12 23:05:59 +02:00
$base_currency : '%partdb.default_currency%'
2019-10-19 17:13:13 +02:00
2022-12-18 17:28:42 +01:00
App\Services\Tools\ExchangeRateUpdater :
2020-06-07 22:38:10 +02:00
arguments :
$base_currency : '%partdb.default_currency%'
2020-05-12 23:05:59 +02:00
###################################################################################################################
# User system
####################################################################################################################
2019-10-20 00:01:06 +02:00
App\Form\UserSettingsType :
arguments :
2020-05-12 22:53:42 +02:00
$demo_mode : '%partdb.demo_mode%'
2019-10-19 17:13:13 +02:00
2020-04-09 17:24:16 +02:00
App\EventSubscriber\UserSystem\SetUserTimezoneSubscriber :
2019-09-12 22:16:33 +02:00
arguments :
2023-06-11 14:50:47 +02:00
$default_timezone : '%partdb.timezone%'
2019-09-12 22:16:33 +02:00
2019-12-01 12:48:59 +01:00
App\Controller\SecurityController :
arguments :
2020-05-12 22:53:42 +02:00
$allow_email_pw_reset : '%partdb.users.email_pw_reset%'
2019-12-01 12:48:59 +01:00
2022-11-14 20:07:20 +01:00
App\Services\UserSystem\TFA\BackupCodeGenerator :
2019-12-27 15:20:06 +01:00
arguments :
$code_length : 8
2019-12-27 18:21:12 +01:00
$code_count : 15
2019-12-27 15:20:06 +01:00
2019-09-10 22:48:17 +02:00
App\Services\TranslationExtractor\PermissionExtractor :
tags :
2020-04-17 21:10:08 +02:00
- { name: 'translation.extractor', alias : 'permissionExtractor' }
2023-01-23 23:01:57 +01:00
App\Services\UserSystem\UserAvatarHelper :
arguments :
$use_gravatar : '%partdb.users.use_gravatar%'
2023-02-01 23:15:02 +01:00
App\Form\Type\ThemeChoiceType :
arguments :
$available_themes : '%partdb.available_themes%'
2023-02-01 23:50:54 +01:00
App\Validator\Constraints\ValidThemeValidator :
arguments :
$available_themes : '%partdb.available_themes%'
2023-02-23 23:36:40 +01:00
App\Command\User\ConvertToSAMLUserCommand :
arguments :
$saml_enabled : '%partdb.saml.enabled%'
2023-10-04 21:14:57 +02:00
####################################################################################################################
# Table settings
####################################################################################################################
App\DataTables\PartsDataTable :
arguments :
2023-10-08 21:28:37 +02:00
$visible_columns : '%partdb.table.parts.default_columns%'
2023-10-08 21:07:22 +02:00
App\DataTables\Helpers\ColumnSortHelper :
shared : false # Service has a state so not share it between different tables
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Label system
####################################################################################################################
App\Services\LabelSystem\LabelTextReplacer :
arguments :
$providers : !tagged_iterator 'app.label_placeholder_provider'
2020-04-17 21:10:08 +02:00
# PartLotProvider must be invoked before all other providers, so it can override %%NAME%% placeholder
App\Services\LabelSystem\PlaceholderProviders\PartLotProvider :
tags :
2020-05-12 23:05:59 +02:00
- { name: 'app.label_placeholder_provider', priority : 10 }
2023-07-02 13:57:15 +02:00
App\Services\LabelSystem\DompdfFactory :
arguments :
$fontDirectory : '%kernel.project_dir%/var/dompdf/fonts/'
$tmpDirectory : '%kernel.project_dir%/var/dompdf/tmp/'
2020-05-12 23:05:59 +02:00
####################################################################################################################
2022-08-05 00:24:28 +02:00
# Trees
####################################################################################################################
App\Services\Trees\TreeViewGenerator :
arguments :
$rootNodeExpandedByDefault : '%partdb.sidebar.root_expanded%'
2022-08-13 01:46:53 +02:00
$rootNodeEnabled : '%partdb.sidebar.root_node_enable%'
2022-08-05 00:24:28 +02:00
2023-07-09 14:27:41 +02:00
####################################################################################################################
# Part info provider system
####################################################################################################################
App\Services\InfoProviderSystem\ProviderRegistry :
arguments :
$providers : !tagged_iterator 'app.info_provider'
2023-07-09 18:51:54 +02:00
App\Services\InfoProviderSystem\Providers\Element14Provider :
arguments :
2023-07-17 00:19:02 +02:00
$api_key : '%env(string:PROVIDER_ELEMENT14_KEY)%'
$store_id : '%env(string:PROVIDER_ELEMENT14_STORE_ID)%'
2023-07-09 18:51:54 +02:00
2023-07-16 03:07:53 +02:00
App\Services\InfoProviderSystem\Providers\DigikeyProvider :
arguments :
2023-07-17 00:19:02 +02:00
$clientId : '%env(string:PROVIDER_DIGIKEY_CLIENT_ID)%'
$currency : '%env(string:PROVIDER_DIGIKEY_CURRENCY)%'
$language : '%env(string:PROVIDER_DIGIKEY_LANGUAGE)%'
$country : '%env(string:PROVIDER_DIGIKEY_COUNTRY)%'
2023-07-16 03:07:53 +02:00
2023-07-15 01:01:20 +02:00
App\Services\InfoProviderSystem\Providers\TMEClient :
arguments :
2023-07-17 00:19:02 +02:00
$secret : '%env(string:PROVIDER_TME_SECRET)%'
$token : '%env(string:PROVIDER_TME_KEY)%'
App\Services\InfoProviderSystem\Providers\TMEProvider :
arguments :
$currency : '%env(string:PROVIDER_TME_CURRENCY)%'
$country : '%env(string:PROVIDER_TME_COUNTRY)%'
$language : '%env(string:PROVIDER_TME_LANGUAGE)%'
$get_gross_prices : '%env(bool:PROVIDER_TME_GET_GROSS_PRICES)%'
2023-07-15 01:01:20 +02:00
2023-07-31 00:57:33 +02:00
App\Services\InfoProviderSystem\Providers\OctopartProvider :
arguments :
$clientId : '&env(string:PROVIDER_OCTOPART_CLIENT_ID)%'
$secret : '%env(string:PROVIDER_OCTOPART_SECRET)%'
$country : '%env(string:PROVIDER_OCTOPART_COUNTRY)%'
$currency : '%env(string:PROVIDER_OCTOPART_CURRENCY)%'
$search_limit : '%env(int:PROVIDER_OCTOPART_SEARCH_LIMIT)%'
$onlyAuthorizedSellers : '%env(bool:PROVIDER_OCTOPART_ONLY_AUTHORIZED_SELLERS)%'
2023-10-07 23:46:31 +02:00
App\Services\InfoProviderSystem\Providers\MouserProvider :
arguments :
$api_key : '%env(string:PROVIDER_MOUSER_KEY)%'
2023-10-08 00:33:48 +02:00
$language : '%env(string:PROVIDER_MOUSER_SEARCH_WITH_SIGNUP_LANGUAGE)%'
$options : '%env(string:PROVIDER_MOUSER_SEARCH_OPTION)%'
2023-10-07 23:46:31 +02:00
$search_limit : '%env(int:PROVIDER_MOUSER_SEARCH_LIMIT)%'
2024-02-22 23:32:12 +01:00
App\Services\InfoProviderSystem\Providers\LCSCProvider :
arguments :
$enabled : '%env(bool:PROVIDER_LCSC_ENABLED)%'
2024-02-22 23:57:57 +01:00
$currency : '%env(string:PROVIDER_LCSC_CURRENCY)%'
2024-02-22 23:32:12 +01:00
2024-09-09 00:59:44 +02:00
App\Services\InfoProviderSystem\Providers\OEMSecretsProvider :
arguments :
$api_key : '%env(string:PROVIDER_OEMSECRETS_KEY)%'
$country_code : '%env(string:PROVIDER_OEMSECRETS_COUNTRY_CODE)%'
$currency : '%env(PROVIDER_OEMSECRETS_CURRENCY)%'
$zero_price : '%env(PROVIDER_OEMSECRETS_ZERO_PRICE)%'
$set_param : '%env(PROVIDER_OEMSECRETS_SET_PARAM)%'
$sort_criteria : '%env(PROVIDER_OEMSECRETS_SORT_CRITERIA)%'
2023-08-06 00:42:34 +02:00
####################################################################################################################
# API system
####################################################################################################################
App\State\PartDBInfoProvider :
arguments :
$default_uri : '%partdb.default_uri%'
$global_locale : '%partdb.locale%'
$global_timezone : '%partdb.timezone%'
2023-12-03 14:42:20 +01:00
####################################################################################################################
# EDA system
####################################################################################################################
App\Services\EDA\KiCadHelper :
arguments :
$category_depth : '%env(int:EDA_KICAD_CATEGORY_DEPTH)%'
2022-08-05 00:24:28 +02:00
####################################################################################################################
2020-05-12 23:05:59 +02:00
# Symfony overrides
####################################################################################################################
# Dont use JSONSerializable Interface,
serializer.normalizer.json_serializable :
class : Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
tags :
- {name: serializer.normalizer, priority : -9000 }
2023-04-17 00:55:41 +02:00
# Disable igbinary serialization for cache even when igbinary is available, as it causes issues with the doctrine
# proxy objects (see https://github.com/igbinary/igbinary/issues/377 and https://github.com/igbinary/igbinary/issues/273)
cache.default_marshaller :
class : Symfony\Component\Cache\Marshaller\DefaultMarshaller
arguments :
$useIgbinarySerialize : false
2020-05-12 23:05:59 +02:00
####################################################################################################################
# Miscellaneous
####################################################################################################################
App\Controller\RedirectController :
arguments :
$default_locale : '%partdb.locale%'
$enforce_index_php : '%env(bool:NO_URL_REWRITE_AVAILABLE)%'
2021-10-02 20:14:48 +02:00
App\Doctrine\Purger\ResetAutoIncrementPurgerFactory :
tags :
- { name: 'doctrine.fixtures.purger_factory', alias : 'reset_autoincrement_purger' }
2023-01-23 21:46:24 +01:00
2023-06-18 22:06:06 +02:00
# We are needing this service inside a migration, where only the container is injected. So we need to define it as public, to access it from the container.
2023-01-23 21:46:24 +01:00
App\Services\UserSystem\PermissionPresetsHelper :
public : true
2023-01-29 00:47:03 +01:00
App\Command\BackupCommand :
arguments :
$project_dir : '%kernel.project_dir%'
2023-02-04 23:51:02 +01:00
2023-08-04 23:55:41 +02:00
App\Services\System\UpdateAvailableManager :
arguments :
$check_for_updates : '%partdb.check_for_updates%'
2023-08-06 00:42:34 +02:00
App\Services\System\BannerHelper :
arguments :
$partdb_banner : '%partdb.banner%'
$project_dir : '%kernel.project_dir%'
2023-12-10 00:36:29 +01:00
App\Doctrine\Middleware\MySQLSSLConnectionMiddlewareWrapper :
arguments :
$enabled : '%env(bool:DATABASE_MYSQL_USE_SSL_CA)%'
$verify : '%env(bool:DATABASE_MYSQL_SSL_VERIFY_CERT)%'
2023-08-06 00:42:34 +02:00
2023-02-04 23:51:02 +01:00
####################################################################################################################
# Monolog
####################################################################################################################
# Add various monolog processors to log more information
Symfony\Bridge\Monolog\Processor\WebProcessor :
tags :
- { name : monolog.processor }
Symfony\Bridge\Monolog\Processor\ConsoleCommandProcessor :
tags :
- { name : monolog.processor }
Symfony\Bridge\Monolog\Processor\TokenProcessor :
autowire : true
tags :
- { name : monolog.processor }
2023-06-18 23:49:45 +02:00
when@test :
services :
# Decorate the doctrine fixtures load command to use our custom purger by default
doctrine.fixtures_load_command.custom :
decorates : doctrine.fixtures_load_command
class : Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand
arguments :
- '@doctrine.fixtures.loader'
- '@doctrine'
2024-09-09 00:59:44 +02:00
- { default : '@App\Doctrine\Purger\DoNotUsePurgerFactory' }