From 450e7c348bf01f6a3b6595827682c48e3641c16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Dec 2023 16:09:06 +0100 Subject: [PATCH] Fix and clean DI configuration for chill_doc_store for usage with AsyncUpload --- .../Service/StoredObjectManager.php | 7 +++- .../ChillDocStoreBundle/config/services.yaml | 38 +++++++------------ .../src/Resources/config/services.php | 5 --- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php index 34df98fa2..e5f7c4ee4 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php +++ b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Service; use Base64Url\Base64Url; -use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlGeneratorInterface; +use Chill\DocStoreBundle\AsyncUpload\TempUrlGeneratorInterface; use Chill\DocStoreBundle\Entity\StoredObject; use Chill\DocStoreBundle\Exception\StoredObjectManagerException; use Symfony\Component\HttpFoundation\Request; @@ -27,7 +27,10 @@ final class StoredObjectManager implements StoredObjectManagerInterface private array $inMemory = []; - public function __construct(private readonly HttpClientInterface $client, private readonly TempUrlGeneratorInterface $tempUrlGenerator) {} + public function __construct( + private readonly HttpClientInterface $client, + private readonly TempUrlGeneratorInterface $tempUrlGenerator + ) {} public function getLastModified(StoredObject $document): \DateTimeInterface { diff --git a/src/Bundle/ChillDocStoreBundle/config/services.yaml b/src/Bundle/ChillDocStoreBundle/config/services.yaml index 04fc3ace3..061b0f9c8 100644 --- a/src/Bundle/ChillDocStoreBundle/config/services.yaml +++ b/src/Bundle/ChillDocStoreBundle/config/services.yaml @@ -1,11 +1,12 @@ -parameters: -# cl_chill_person.example.class: Chill\PersonBundle\Example - services: - Chill\DocStoreBundle\Repository\: + _defaults: autowire: true autoconfigure: true + + Chill\DocStoreBundle\Repository\: resource: "../Repository/" + tags: + - { name: doctrine.repository_service } Chill\DocStoreBundle\Form\DocumentCategoryType: class: Chill\DocStoreBundle\Form\DocumentCategoryType @@ -15,8 +16,6 @@ services: Chill\DocStoreBundle\Form\PersonDocumentType: class: Chill\DocStoreBundle\Form\PersonDocumentType - autowire: true - autoconfigure: true # arguments: # - "@chill.main.helper.translatable_string" tags: @@ -24,50 +23,41 @@ services: Chill\DocStoreBundle\Security\Authorization\: resource: "./../Security/Authorization" - autowire: true - autoconfigure: true tags: - { name: chill.role } Chill\DocStoreBundle\Workflow\: resource: './../Workflow/' - autoconfigure: true - autowire: true Chill\DocStoreBundle\Serializer\Normalizer\: - autowire: true resource: '../Serializer/Normalizer/' tags: - - { name: 'serializer.normalizer', priority: 16 } + - { name: serializer.normalizer, priority: 16 } Chill\DocStoreBundle\Service\: - autowire: true - autoconfigure: true resource: '../Service/' Chill\DocStoreBundle\GenericDoc\Manager: - autowire: true - autoconfigure: true arguments: $providersForAccompanyingPeriod: !tagged_iterator chill_doc_store.generic_doc_accompanying_period_provider $providersForPerson: !tagged_iterator chill_doc_store.generic_doc_person_provider - Chill\DocStoreBundle\GenericDoc\Twig\GenericDocExtension: - autoconfigure: true - autowire: true + Chill\DocStoreBundle\GenericDoc\Twig\GenericDocExtension: ~ Chill\DocStoreBundle\GenericDoc\Twig\GenericDocExtensionRuntime: - autoconfigure: true - autowire: true arguments: $renderers: !tagged_iterator chill_doc_store.generic_doc_renderer Chill\DocStoreBundle\GenericDoc\Providers\: - autowire: true - autoconfigure: true resource: '../GenericDoc/Providers/' Chill\DocStoreBundle\GenericDoc\Renderer\: + resource: '../GenericDoc/Renderer/' + + Chill\DocStoreBundle\AsyncUpload\Driver\: autowire: true autoconfigure: true - resource: '../GenericDoc/Renderer/' + resource: '../AsyncUpload/Driver/' + + Chill\DocStoreBundle\AsyncUpload\TempUrlGeneratorInterface: + alias: Chill\DocStoreBundle\AsyncUpload\Driver\OpenstackObjectStore\TempUrlOpenstackGenerator diff --git a/src/Bundle/ChillWopiBundle/src/Resources/config/services.php b/src/Bundle/ChillWopiBundle/src/Resources/config/services.php index a962c9e67..005994bb6 100644 --- a/src/Bundle/ChillWopiBundle/src/Resources/config/services.php +++ b/src/Bundle/ChillWopiBundle/src/Resources/config/services.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlGeneratorInterface; use ChampsLibres\WopiBundle\Contracts\AuthorizationManagerInterface; use ChampsLibres\WopiBundle\Contracts\UserManagerInterface; use ChampsLibres\WopiBundle\Service\Wopi as CLWopi; @@ -60,8 +59,4 @@ return static function (ContainerConfigurator $container) { ->set(UserManager::class); $services->alias(UserManagerInterface::class, UserManager::class); - - // TODO: Move this into the async bundle (low priority) - $services - ->alias(TempUrlGeneratorInterface::class, 'async_uploader.temp_url_generator'); };