-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathConfiguration.php
More file actions
80 lines (74 loc) · 3.71 KB
/
Configuration.php
File metadata and controls
80 lines (74 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
namespace Artgris\Bundle\FileManagerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* @author Arthur Gribet <a.gribet@gmail.com>
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder(): TreeBuilder {
// symfony > 4.2
$treeBuilder = new TreeBuilder('artgris_file_manager');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->scalarNode('web_dir')
->defaultValue('%kernel.project_dir%/public')
->end()
->arrayNode('conf')
->prototype('array')
->children()
->scalarNode('dir')->end()
->enumNode('type')->values(['file', 'image', 'media'])->end()
->booleanNode('tree')->end()
->booleanNode('show_file_count')->defaultValue(true)->end()
->scalarNode('root_name')->defaultValue(null)->end()
->scalarNode('twig_extension')->end()
->booleanNode('cachebreaker')->defaultValue(true)->end()
->enumNode('view')->values(['thumbnail', 'list'])->defaultValue('list')->end()
->scalarNode('regex')->end()
->scalarNode('service')->end()
->scalarNode('accept')->end()
->arrayNode('upload')
->children()
->integerNode('min_file_size')->end()
->integerNode('max_file_size')->end()
->integerNode('max_width')->end()
->integerNode('max_height')->end()
->integerNode('min_width')->end()
->integerNode('min_height')->end()
->integerNode('image_library')->end()
->arrayNode('image_versions')
->prototype('array')
->children()
->booleanNode('auto_orient')->end()
->booleanNode('crop')->end()
->integerNode('max_width')->end()
->integerNode('max_height')->end()
->end()
->end()
->end()
->booleanNode('override')->defaultValue(false)->end()
->end()
->children()
->arrayNode('filename_sanitizer')
->children()
->scalarNode('transformer')->end()
->booleanNode('slugger')->end()
->scalarNode('prepend')->end()
->scalarNode('append')->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}