1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Kunstmaan\MediaBundle\DependencyInjection; |
4
|
|
|
|
5
|
|
|
use Kunstmaan\MediaBundle\Utils\SymfonyVersion; |
6
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
7
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* This is the class that validates and merges configuration from your app/config files |
11
|
|
|
* |
12
|
|
|
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} |
13
|
|
|
*/ |
14
|
|
|
class Configuration implements ConfigurationInterface |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* Generates the configuration tree. |
18
|
|
|
* |
19
|
|
|
* @return TreeBuilder |
20
|
|
|
*/ |
21
|
5 |
|
public function getConfigTreeBuilder() |
22
|
|
|
{ |
23
|
5 |
|
$treeBuilder = new TreeBuilder('kunstmaan_media'); |
24
|
5 |
|
if (method_exists($treeBuilder, 'getRootNode')) { |
25
|
5 |
|
$rootNode = $treeBuilder->getRootNode(); |
26
|
|
|
} else { |
27
|
|
|
// BC layer for symfony/config 4.1 and older |
28
|
|
|
$rootNode = $treeBuilder->root('kunstmaan_media'); |
|
|
|
|
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
$rootNode |
32
|
5 |
|
->children() |
33
|
5 |
|
->scalarNode('soundcloud_api_key')->defaultValue('YOUR_CLIENT_ID')->end() |
34
|
5 |
|
->scalarNode('aviary_api_key')->defaultNull()->end() |
35
|
5 |
|
->arrayNode('remote_video') |
36
|
5 |
|
->addDefaultsIfNotSet() |
37
|
5 |
|
->children() |
38
|
5 |
|
->booleanNode('vimeo')->defaultTrue()->end() |
39
|
5 |
|
->booleanNode('youtube')->defaultTrue()->end() |
40
|
5 |
|
->booleanNode('dailymotion')->defaultTrue()->end() |
41
|
5 |
|
->end() |
42
|
5 |
|
->end() |
43
|
5 |
|
->booleanNode('enable_pdf_preview')->defaultFalse()->end() |
44
|
5 |
|
->arrayNode('blacklisted_extensions') |
45
|
5 |
|
->defaultValue(['php', 'htaccess']) |
46
|
5 |
|
->prototype('scalar')->end() |
47
|
5 |
|
->end() |
48
|
5 |
|
->scalarNode('web_root') |
49
|
5 |
|
->defaultValue(SymfonyVersion::getRootWebPath()) |
50
|
5 |
|
->cannotBeEmpty() |
51
|
5 |
|
->end() |
52
|
5 |
|
->arrayNode('cropping_views') |
53
|
|
|
->children() |
54
|
5 |
|
->arrayNode('default') |
55
|
|
|
->arrayPrototype() |
56
|
|
|
->addDefaultsIfNotSet() |
57
|
|
|
->children() |
58
|
|
|
->scalarNode('name')->end() |
59
|
|
|
->integerNode('width')->end() |
60
|
|
|
->integerNode('height')->end() |
61
|
|
|
->booleanNode('lockRatio')->defaultTrue()->end() |
62
|
|
|
->end() |
63
|
|
|
->end() |
64
|
|
|
->end() |
65
|
|
|
->arrayNode('focus_point_classes') |
66
|
|
|
->defaultValue(['top-left' ,'top-center', 'top-right', 'center-left', 'center', 'center-right', 'bottom-left', 'bottom-center', 'bottom-right']) |
67
|
|
|
->prototype('array')->end() |
68
|
|
|
->end() |
69
|
|
|
->arrayNode('custom_views') |
70
|
|
|
->useAttributeAsKey('groupName') |
71
|
|
|
->arrayPrototype() |
72
|
|
|
->addDefaultsIfNotSet() |
73
|
|
|
->children() |
74
|
|
|
->booleanNode('useFocusPoint')->defaultFalse()->end() |
75
|
|
|
->arrayNode('views') |
76
|
|
|
->arrayPrototype() |
77
|
|
|
->addDefaultsIfNotSet() |
78
|
|
|
->children() |
79
|
|
|
->scalarNode('name')->end() |
80
|
|
|
->integerNode('width')->end() |
81
|
|
|
->integerNode('height')->end() |
82
|
|
|
->booleanNode('lockRatio')->defaultTrue()->end() |
83
|
|
|
->end() |
84
|
|
|
->end() |
85
|
|
|
->end() |
86
|
|
|
->end() |
87
|
|
|
->end() |
88
|
|
|
->end() |
89
|
|
|
->end() |
90
|
|
|
->end() |
91
|
|
|
->end(); |
92
|
|
|
|
93
|
|
|
return $treeBuilder; |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.