1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace Debril\RssAtomBundle\DependencyInjection; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
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
|
|
|
* {@inheritDoc} |
18
|
|
|
*/ |
19
|
|
|
public function getConfigTreeBuilder() : TreeBuilder |
20
|
|
|
{ |
21
|
|
|
$treeBuilder = new TreeBuilder('debril_rss_atom'); |
22
|
|
|
|
23
|
|
|
// For BC with symfony/config < 4.2 |
24
|
|
|
if (method_exists($treeBuilder, 'getRootNode')) { |
25
|
|
|
/** @var ArrayNodeDefinition $rootNode */ |
26
|
|
|
$rootNode = $treeBuilder->getRootNode(); |
27
|
|
|
} else { |
28
|
|
|
$rootNode = $treeBuilder->root('debril_rss_atom'); |
|
|
|
|
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
$rootNode |
32
|
|
|
->children() |
33
|
|
|
->booleanNode('private') |
34
|
|
|
->info('Change cache headers so the RSS feed is not cached by public caches (like reverse-proxies...).') |
35
|
|
|
->defaultValue(false) |
36
|
|
|
->end() |
37
|
|
|
->booleanNode('force_refresh') |
38
|
|
|
->info('Do not send 304 status if the feed has not been modified since last hit') |
39
|
|
|
->defaultValue(false) |
40
|
|
|
->end() |
41
|
|
|
->scalarNode('content_type_json') |
42
|
|
|
->info('Content-Type header value to use for json feed generation.') |
43
|
|
|
->defaultValue('application/json') |
44
|
|
|
->end() |
45
|
|
|
->scalarNode('content_type_xml') |
46
|
|
|
->info('Content-Type header value to use for xml feed generation (atom and rss).') |
47
|
|
|
->defaultValue('application/xhtml+xml') |
48
|
|
|
->end() |
49
|
|
|
->arrayNode('date_formats') |
50
|
|
|
->prototype('scalar')->end() |
51
|
|
|
->end() |
52
|
|
|
->end() |
53
|
|
|
; |
54
|
|
|
|
55
|
|
|
// Here you should define the parameters that are allowed to |
56
|
|
|
// configure your bundle. See the documentation linked above for |
57
|
|
|
// more information on that topic. |
58
|
|
|
return $treeBuilder; |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
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.