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' => '%env(string:RAPSYSAIR_CALENDAR)',
76 'prefix' => '%env(string:RAPSYSAIR_PREFIX)',
77 'project' => '%env(string:RAPSYSAIR_PROJECT)',
78 'client' => '%env(string:GOOGLE_CLIENT_ID)',
79 'secret' => '%env(string:GOOGLE_CLIENT_SECRET)'
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 'languages' => '%rapsys_user.languages%',
101 'cache' => '%kernel.project_dir%/var/cache',
102 'public' => dirname(__DIR__
).'/Resources/public'
106 //Here we define the parameters that are allowed to configure the bundle.
107 //TODO: see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php for default value and description
108 //TODO: see http://symfony.com/doc/current/components/config/definition.html
109 //XXX: use bin/console config:dump-reference to dump class infos
111 //Here we define the parameters that are allowed to configure the bundle.
115 ->addDefaultsIfNotSet()
118 ->addDefaultsIfNotSet()
120 ->scalarNode('donate')->cannotBeEmpty()->defaultValue($defaults['site']['donate'])->end()
121 ->scalarNode('ico')->cannotBeEmpty()->defaultValue($defaults['site']['ico'])->end()
122 ->scalarNode('logo')->cannotBeEmpty()->defaultValue($defaults['site']['logo'])->end()
125 ->defaultValue($defaults['site']['png'])
126 ->scalarPrototype()->end()
128 ->scalarNode('svg')->cannotBeEmpty()->defaultValue($defaults['site']['svg'])->end()
129 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['site']['title'])->end()
130 ->scalarNode('url')->cannotBeEmpty()->defaultValue($defaults['site']['url'])->end()
134 ->addDefaultsIfNotSet()
136 ->scalarNode('namespace')->defaultValue($defaults['cache']['namespace'])->end()
137 ->integerNode('lifetime')->min(0)->defaultValue($defaults['cache']['lifetime'])->end()
140 ->arrayNode('calendar')
141 ->addDefaultsIfNotSet()
143 ->scalarNode('calendar')->defaultValue($defaults['calendar']['calendar'])->end()
144 ->scalarNode('prefix')->defaultValue($defaults['calendar']['prefix'])->end()
145 ->scalarNode('project')->defaultValue($defaults['calendar']['project'])->end()
146 ->scalarNode('client')->defaultValue($defaults['calendar']['client'])->end()
147 ->scalarNode('secret')->defaultValue($defaults['calendar']['secret'])->end()
151 ->addDefaultsIfNotSet()
153 ->scalarNode('by')->defaultValue($defaults['copy']['by'])->end()
154 ->scalarNode('link')->defaultValue($defaults['copy']['link'])->end()
155 ->scalarNode('long')->defaultValue($defaults['copy']['long'])->end()
156 ->scalarNode('short')->defaultValue($defaults['copy']['short'])->end()
157 ->scalarNode('title')->defaultValue($defaults['copy']['title'])->end()
160 ->arrayNode('contact')
161 ->addDefaultsIfNotSet()
163 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['contact']['title'])->end()
164 ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
167 ->arrayNode('facebook')
168 ->addDefaultsIfNotSet()
172 ->defaultValue($defaults['facebook']['apps'])
173 ->scalarPrototype()->end()
175 ->integerNode('height')->min(0)->defaultValue($defaults['facebook']['height'])->end()
176 ->integerNode('width')->min(0)->defaultValue($defaults['facebook']['width'])->end()
179 ->scalarNode('locale')->cannotBeEmpty()->defaultValue($defaults['locale'])->end()
180 ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
181 ->scalarNode('languages')->cannotBeEmpty()->defaultValue($defaults['languages'])->end()
183 ->addDefaultsIfNotSet()
185 ->scalarNode('cache')->defaultValue($defaults['path']['cache'])->end()
186 ->scalarNode('public')->defaultValue($defaults['path']['public'])->end()