3 namespace Rapsys\AirBundle\DependencyInjection
;
5 use Symfony\Component\Config\Definition\Builder\TreeBuilder
;
6 use Symfony\Component\Config\Definition\ConfigurationInterface
;
9 * This is the class that validates and merges configuration from your app/config files.
11 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
13 class Configuration
implements ConfigurationInterface
{
17 public function getConfigTreeBuilder() {
18 $treeBuilder = new TreeBuilder('rapsys_air');
20 // Here you should define the parameters that are allowed to
21 // configure your bundle. See the documentation linked above for
22 // more information on that topic.
26 'donate' => 'https://paypal.me/milongaraphael',
27 'ico' => '@RapsysAir/ico/icon.ico',
28 'logo' => '@RapsysAir/png/logo.png',
30 //XXX: see https://www.emergeinteractive.com/insights/detail/the-essentials-of-favicons/
31 //XXX: see https://caniuse.com/#feat=link-icon-svg
34 256 => '@RapsysAir/png/icon.256.png',
37 //Chrome for Android home screen icon
38 196 => '@RapsysAir/png/icon.196.png',
39 //Google Developer Web App Manifest Recommendation
40 192 => '@RapsysAir/png/icon.192.png',
41 //Chrome Web Store icon
42 128 => '@RapsysAir/png/icon.128.png',
45 32 => '@RapsysAir/png/icon.32.png',
48 //XXX: old obsolete format: [57, 72, 76, 114, 120, 144]
49 //XXX: see https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/
50 //XXX: see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
52 180 => '@RapsysAir/png/icon.180.png',
53 //iPad Retina touch icon
54 167 => '@RapsysAir/png/icon.167.png',
56 152 => '@RapsysAir/png/icon.152.png',
58 120 => '@RapsysAir/png/icon.120.png',
61 //XXX: see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn255024(v=vs.85)
62 310 => '@RapsysAir/png/icon.310.png',
63 150 => '@RapsysAir/png/icon.150.png',
64 70 => '@RapsysAir/png/icon.70.png'
66 'svg' => '@RapsysAir/svg/icon.svg',
67 'title' => 'Libre Air',
71 'namespace' => 'airlibre',
75 'calendar' => 'rmg68hd51sploubp5qffdthiak@group.calendar.google.com',
76 'prefix' => 'airlibre',
77 'project' => 'calendar-317315',
78 'client' => '635317121880-usqucmne71jnmprl8br9khh2om4n8cmh.apps.googleusercontent.com',
79 'secret' => 'HRsKd4FIc9gxQHM4IoBWnlbD'
83 'link' => 'https://rapsys.eu',
84 'long' => 'All rights reserved',
85 'short' => 'Copyright 2019-2021',
89 'title' => 'Libre Air',
90 'mail' => 'contact@airlibre.eu'
93 'apps' => [3728770287223690],
97 'locale' => '%kernel.default_locale%',
98 'locales' => '%kernel.translator.fallbacks%',
99 //XXX: revert to underscore because of that shit:
100 //XXX: see https://symfony.com/doc/current/components/config/definition.html#normalization
101 //XXX: see https://github.com/symfony/symfony/issues/7405
102 'languages' => '%rapsys_user.languages%',
104 'cache' => '%kernel.project_dir%/var/cache',
105 'public' => dirname(__DIR__
).'/Resources/public'
109 //Here we define the parameters that are allowed to configure the bundle.
110 //TODO: see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php for default value and description
111 //TODO: see http://symfony.com/doc/current/components/config/definition.html
112 //XXX: use bin/console config:dump-reference to dump class infos
114 //Here we define the parameters that are allowed to configure the bundle.
118 ->addDefaultsIfNotSet()
121 ->addDefaultsIfNotSet()
123 ->scalarNode('donate')->cannotBeEmpty()->defaultValue($defaults['site']['donate'])->end()
124 ->scalarNode('ico')->cannotBeEmpty()->defaultValue($defaults['site']['ico'])->end()
125 ->scalarNode('logo')->cannotBeEmpty()->defaultValue($defaults['site']['logo'])->end()
128 ->defaultValue($defaults['site']['png'])
129 ->scalarPrototype()->end()
131 ->scalarNode('svg')->cannotBeEmpty()->defaultValue($defaults['site']['svg'])->end()
132 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['site']['title'])->end()
133 ->scalarNode('url')->cannotBeEmpty()->defaultValue($defaults['site']['url'])->end()
137 ->addDefaultsIfNotSet()
139 ->scalarNode('namespace')->defaultValue($defaults['cache']['namespace'])->end()
140 ->integerNode('lifetime')->min(0)->defaultValue($defaults['cache']['lifetime'])->end()
143 ->arrayNode('calendar')
144 ->addDefaultsIfNotSet()
146 ->scalarNode('calendar')->defaultValue($defaults['calendar']['calendar'])->end()
147 ->scalarNode('prefix')->defaultValue($defaults['calendar']['prefix'])->end()
148 ->scalarNode('project')->defaultValue($defaults['calendar']['project'])->end()
149 ->scalarNode('client')->defaultValue($defaults['calendar']['client'])->end()
150 ->scalarNode('secret')->defaultValue($defaults['calendar']['secret'])->end()
154 ->addDefaultsIfNotSet()
156 ->scalarNode('by')->defaultValue($defaults['copy']['by'])->end()
157 ->scalarNode('link')->defaultValue($defaults['copy']['link'])->end()
158 ->scalarNode('long')->defaultValue($defaults['copy']['long'])->end()
159 ->scalarNode('short')->defaultValue($defaults['copy']['short'])->end()
160 ->scalarNode('title')->defaultValue($defaults['copy']['title'])->end()
163 ->arrayNode('contact')
164 ->addDefaultsIfNotSet()
166 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['contact']['title'])->end()
167 ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
170 ->arrayNode('facebook')
171 ->addDefaultsIfNotSet()
175 ->defaultValue($defaults['facebook']['apps'])
176 ->scalarPrototype()->end()
178 ->integerNode('height')->min(0)->defaultValue($defaults['facebook']['height'])->end()
179 ->integerNode('width')->min(0)->defaultValue($defaults['facebook']['width'])->end()
182 ->scalarNode('locale')->cannotBeEmpty()->defaultValue($defaults['locale'])->end()
183 ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
184 ->scalarNode('languages')->cannotBeEmpty()->defaultValue($defaults['languages'])->end()
186 ->addDefaultsIfNotSet()
188 ->scalarNode('cache')->defaultValue($defaults['path']['cache'])->end()
189 ->scalarNode('public')->defaultValue($defaults['path']['public'])->end()