Add configuration option to select storage driver

Introduces a new `use_driver` configuration option to specify the desired storage driver (`local_storage` or `openstack`). Ensures proper validation to handle multiple drivers and throws appropriate errors when configurations are inconsistent or missing. Refactors related logic to improve clarity and maintainability.
This commit is contained in:
2025-01-07 10:36:10 +01:00
parent 812e4047d0
commit 73bcfb82b7
2 changed files with 29 additions and 3 deletions

View File

@@ -30,6 +30,10 @@ class Configuration implements ConfigurationInterface
/* @phpstan-ignore-next-line As there are inconsistencies in return types, but the code works... */
$rootNode->children()
->enumNode('use_driver')
->values(['local_storage', 'openstack'])
->info('Driver to use. Default to the single one if multiple driver are defined. Configuration will raise an error if there are multiple drivers defined, and if this key is not set')
->end()
->arrayNode('local_storage')
->info('where the stored object should be stored')
->children()