Move Import configuration to Core

This commit is contained in:
Yassine Guedidi 2024-01-01 17:04:08 +01:00
parent 8b13631e3d
commit 6552c84eec
5 changed files with 7 additions and 17 deletions

View file

@ -162,7 +162,5 @@ wallabag_core:
- 'Montserrat'
- 'OpenDyslexicRegular'
- 'Oswald'
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv', 'text/html']
resource_dir: "%kernel.project_dir%/web/uploads/import"

View file

@ -75,6 +75,11 @@ class Configuration implements ConfigurationInterface
->arrayNode('fonts')
->prototype('scalar')->end()
->end()
->arrayNode('allow_mimetypes')
->prototype('scalar')->end()
->end()
->scalarNode('resource_dir')
->end()
->end()
;

View file

@ -30,6 +30,8 @@ class WallabagCoreExtension extends Extension
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
$container->setParameter('wallabag_core.fonts', $config['fonts']);
$container->setParameter('wallabag_import.allow_mimetypes', $config['allow_mimetypes']);
$container->setParameter('wallabag_import.resource_dir', $config['resource_dir']);
}
public function getAlias()

View file

@ -10,17 +10,6 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('wallabag_import');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->arrayNode('allow_mimetypes')
->prototype('scalar')->end()
->end()
->scalarNode('resource_dir')
->end()
->end()
;
return $treeBuilder;
}

View file

@ -9,10 +9,6 @@ class WallabagImportExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('wallabag_import.allow_mimetypes', $config['allow_mimetypes']);
$container->setParameter('wallabag_import.resource_dir', $config['resource_dir']);
}
public function getAlias()