@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | use Laminas\Uri\UriFactory; |
17 | 17 | |
18 | 18 | class Module implements |
19 | - BootstrapListenerInterface, |
|
20 | - ConfigProviderInterface, |
|
21 | - ServiceProviderInterface, |
|
22 | - ViewHelperProviderInterface |
|
19 | + BootstrapListenerInterface, |
|
20 | + ConfigProviderInterface, |
|
21 | + ServiceProviderInterface, |
|
22 | + ViewHelperProviderInterface |
|
23 | 23 | { |
24 | - public function init(ModuleManager $manager) |
|
25 | - { |
|
24 | + public function init(ModuleManager $manager) |
|
25 | + { |
|
26 | 26 | $eventManager = $manager->getEventManager(); |
27 | 27 | |
28 | 28 | /* |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | * This config takes part in the Playground Theme Management |
32 | 32 | */ |
33 | 33 | $eventManager->attach(\Laminas\ModuleManager\ModuleEvent::EVENT_MERGE_CONFIG, array($this, 'onMergeConfig'), 100); |
34 | - } |
|
35 | - |
|
36 | - /** |
|
37 | - * This method is called only when the config is not cached. |
|
38 | - * @param \Laminas\ModuleManager\ModuleEvent $e |
|
39 | - */ |
|
40 | - public function onMergeConfig(\Laminas\ModuleManager\ModuleEvent $e) |
|
41 | - { |
|
34 | + } |
|
35 | + |
|
36 | + /** |
|
37 | + * This method is called only when the config is not cached. |
|
38 | + * @param \Laminas\ModuleManager\ModuleEvent $e |
|
39 | + */ |
|
40 | + public function onMergeConfig(\Laminas\ModuleManager\ModuleEvent $e) |
|
41 | + { |
|
42 | 42 | $config = $e->getConfigListener()->getMergedConfig(false); |
43 | 43 | |
44 | 44 | if (isset($config['playgroundLocale']) && isset($config['playgroundLocale']['enable']) && $config['playgroundLocale']['enable']) { |
45 | - $config['router']['routes']['frontend']['options']['route'] = '/[:locale[/]]'; |
|
46 | - $config['router']['routes']['frontend']['options']['constraints']['locale'] = '[a-z]{2}([-_][A-Z]{2})?(?=/|$)'; |
|
47 | - $config['router']['routes']['frontend']['options']['defaults']['locale'] = $config['playgroundLocale']['default']; |
|
45 | + $config['router']['routes']['frontend']['options']['route'] = '/[:locale[/]]'; |
|
46 | + $config['router']['routes']['frontend']['options']['constraints']['locale'] = '[a-z]{2}([-_][A-Z]{2})?(?=/|$)'; |
|
47 | + $config['router']['routes']['frontend']['options']['defaults']['locale'] = $config['playgroundLocale']['default']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $e->getConfigListener()->setMergedConfig($config); |
51 | - } |
|
51 | + } |
|
52 | 52 | |
53 | - public function onBootstrap(EventInterface $e) |
|
54 | - { |
|
53 | + public function onBootstrap(EventInterface $e) |
|
54 | + { |
|
55 | 55 | // this is useful for zfr-cors to accept chrome extension like Postman |
56 | 56 | UriFactory::registerScheme('chrome-extension', 'Laminas\Uri\Uri'); |
57 | 57 | |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | |
65 | 65 | // Gestion de la locale |
66 | 66 | if (PHP_SAPI !== 'cli') { |
67 | - $config = $serviceManager->get('config'); |
|
68 | - if (isset($config['playgroundLocale'])) { |
|
67 | + $config = $serviceManager->get('config'); |
|
68 | + if (isset($config['playgroundLocale'])) { |
|
69 | 69 | $pgLocale = $config['playgroundLocale']; |
70 | 70 | $defaultLocale = $pgLocale['default']; |
71 | 71 | |
72 | 72 | if (isset($pgLocale['strategies'])) { |
73 | - $pgstrat = $pgLocale['strategies']; |
|
73 | + $pgstrat = $pgLocale['strategies']; |
|
74 | 74 | |
75 | - // Is there a locale in the URL ? |
|
76 | - if (in_array('uri', $pgstrat)) { |
|
75 | + // Is there a locale in the URL ? |
|
76 | + if (in_array('uri', $pgstrat)) { |
|
77 | 77 | $path = $e->getRequest()->getUri()->getPath(); |
78 | 78 | $parts = explode('/', trim($path, '/')); |
79 | 79 | $localeCandidate = array_shift($parts); |
@@ -81,67 +81,67 @@ discard block |
||
81 | 81 | $localeCandidate = substr($localeCandidate, 0, 2); |
82 | 82 | |
83 | 83 | if (in_array($localeCandidate, $pgLocale['supported'])) { |
84 | - $locale = $localeCandidate; |
|
84 | + $locale = $localeCandidate; |
|
85 | + } |
|
85 | 86 | } |
86 | - } |
|
87 | 87 | |
88 | - // Is there a cookie for the locale ? |
|
89 | - if (empty($locale) && in_array('cookie', $pgstrat)) { |
|
88 | + // Is there a cookie for the locale ? |
|
89 | + if (empty($locale) && in_array('cookie', $pgstrat)) { |
|
90 | 90 | $serviceManager->get('router')->setTranslator($translator); |
91 | 91 | if ( |
92 | - $serviceManager->get('router')->match($serviceManager->get('request')) && |
|
92 | + $serviceManager->get('router')->match($serviceManager->get('request')) && |
|
93 | 93 | strpos($serviceManager->get('router')->match($serviceManager->get('request'))->getMatchedRouteName(), 'admin') !== false |
94 | 94 | ) { |
95 | - if ( |
|
95 | + if ( |
|
96 | 96 | $e->getRequest()->getCookie() && |
97 | 97 | $e->getRequest()->getCookie()->offsetExists('pg_locale_back') |
98 | - ) { |
|
98 | + ) { |
|
99 | 99 | $locale = $e->getRequest()->getCookie()->offsetGet('pg_locale_back'); |
100 | - } |
|
100 | + } |
|
101 | 101 | } else { |
102 | - if ( |
|
102 | + if ( |
|
103 | 103 | $e->getRequest()->getCookie() && |
104 | 104 | $e->getRequest()->getCookie()->offsetExists('pg_locale_frontend') |
105 | - ) { |
|
105 | + ) { |
|
106 | 106 | $locale = $e->getRequest()->getCookie()->offsetGet('pg_locale_frontend'); |
107 | - } |
|
107 | + } |
|
108 | + } |
|
108 | 109 | } |
109 | - } |
|
110 | 110 | |
111 | - // Is there a locale in the request Header ? |
|
112 | - if (empty($locale) && in_array('header', $pgstrat)) { |
|
111 | + // Is there a locale in the request Header ? |
|
112 | + if (empty($locale) && in_array('header', $pgstrat)) { |
|
113 | 113 | if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
114 | - $localeCandidate = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); |
|
115 | - // I switch from locale to... language |
|
116 | - $localeCandidate = substr($localeCandidate, 0, 2); |
|
117 | - if (in_array($localeCandidate, $pgLocale['supported'])) { |
|
114 | + $localeCandidate = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); |
|
115 | + // I switch from locale to... language |
|
116 | + $localeCandidate = substr($localeCandidate, 0, 2); |
|
117 | + if (in_array($localeCandidate, $pgLocale['supported'])) { |
|
118 | 118 | $locale = $localeCandidate; |
119 | - } |
|
119 | + } |
|
120 | + } |
|
120 | 121 | } |
121 | - } |
|
122 | 122 | } |
123 | 123 | // I take the default locale |
124 | 124 | if (empty($locale)) { |
125 | - $locale = $defaultLocale; |
|
125 | + $locale = $defaultLocale; |
|
126 | + } |
|
126 | 127 | } |
127 | - } |
|
128 | 128 | |
129 | - // I take the default locale |
|
130 | - if (empty($locale)) { |
|
129 | + // I take the default locale |
|
130 | + if (empty($locale)) { |
|
131 | 131 | $locale = $defaultLocale; |
132 | - } |
|
132 | + } |
|
133 | 133 | |
134 | - $translator->setLocale($locale); |
|
134 | + $translator->setLocale($locale); |
|
135 | 135 | |
136 | - $e->getRouter()->setTranslator($translator); |
|
137 | - $e->getRouter()->setTranslatorTextDomain('routes'); |
|
136 | + $e->getRouter()->setTranslator($translator); |
|
137 | + $e->getRouter()->setTranslatorTextDomain('routes'); |
|
138 | 138 | |
139 | - // Attach the translator to the plugins |
|
140 | - $translate = $serviceManager->get('ViewHelperManager')->get('translate'); |
|
141 | - $translate->getTranslator()->setLocale($locale); |
|
139 | + // Attach the translator to the plugins |
|
140 | + $translate = $serviceManager->get('ViewHelperManager')->get('translate'); |
|
141 | + $translate->getTranslator()->setLocale($locale); |
|
142 | 142 | |
143 | - $options = $serviceManager->get('playgroundcore_module_options'); |
|
144 | - $options->setLocale($locale); |
|
143 | + $options = $serviceManager->get('playgroundcore_module_options'); |
|
144 | + $options->setLocale($locale); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | // positionnement de la langue pour les traductions de date avec strftime |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // set Locale |
165 | 165 | if (!empty($locale)) { |
166 | - $translatableListener->setTranslatableLocale($locale); |
|
166 | + $translatableListener->setTranslatableLocale($locale); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $evm->addEventSubscriber($translatableListener); |
@@ -173,28 +173,28 @@ discard block |
||
173 | 173 | */ |
174 | 174 | $filterChain = new \Laminas\Filter\FilterChain(); |
175 | 175 | $filterChain->getPluginManager()->setInvokableClass( |
176 | - 'slugify', |
|
177 | - 'PlaygroundCore\Filter\Slugify' |
|
176 | + 'slugify', |
|
177 | + 'PlaygroundCore\Filter\Slugify' |
|
178 | 178 | ); |
179 | 179 | $filterChain->attach(new Filter\Slugify()); |
180 | 180 | |
181 | 181 | if (PHP_SAPI !== 'cli') { |
182 | - $scheme = strtolower($e->getRequest()->getUri()->getScheme()); |
|
183 | - if ($scheme === 'https') { |
|
182 | + $scheme = strtolower($e->getRequest()->getUri()->getScheme()); |
|
183 | + if ($scheme === 'https') { |
|
184 | 184 | $config['session']['cookie_secure'] = true; |
185 | - } |
|
186 | - |
|
187 | - // Start the session container |
|
188 | - $sessionConfig = new SessionConfig(); |
|
189 | - $sessionConfig->setOptions($config['session']); |
|
190 | - $sessionManager = new SessionManager($sessionConfig); |
|
191 | - $sessionManager->start(); |
|
192 | - |
|
193 | - /** |
|
194 | - * Optional: If you later want to use namespaces, you can already store the |
|
195 | - * Manager in the shared (static) Container (=namespace) field |
|
196 | - */ |
|
197 | - \Laminas\Session\Container::setDefaultManager($sessionManager); |
|
185 | + } |
|
186 | + |
|
187 | + // Start the session container |
|
188 | + $sessionConfig = new SessionConfig(); |
|
189 | + $sessionConfig->setOptions($config['session']); |
|
190 | + $sessionManager = new SessionManager($sessionConfig); |
|
191 | + $sessionManager->start(); |
|
192 | + |
|
193 | + /** |
|
194 | + * Optional: If you later want to use namespaces, you can already store the |
|
195 | + * Manager in the shared (static) Container (=namespace) field |
|
196 | + */ |
|
197 | + \Laminas\Session\Container::setDefaultManager($sessionManager); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -202,22 +202,22 @@ discard block |
||
202 | 202 | // Google Analytics : When the render event is triggered, we invoke the view helper to |
203 | 203 | // render the javascript code. |
204 | 204 | $e->getApplication()->getEventManager()->attach(\Laminas\Mvc\MvcEvent::EVENT_RENDER, function (\Laminas\Mvc\MvcEvent $e) use ($serviceManager) { |
205 | - $view = $serviceManager->get('ViewHelperManager'); |
|
206 | - $plugin = $view->get('googleAnalytics'); |
|
207 | - $plugin(); |
|
205 | + $view = $serviceManager->get('ViewHelperManager'); |
|
206 | + $plugin = $view->get('googleAnalytics'); |
|
207 | + $plugin(); |
|
208 | 208 | |
209 | - $pluginOG = $view->get('facebookOpengraph'); |
|
210 | - $pluginOG(); |
|
209 | + $pluginOG = $view->get('facebookOpengraph'); |
|
210 | + $pluginOG(); |
|
211 | 211 | |
212 | - $pluginTC = $view->get('twitterCard'); |
|
213 | - $pluginTC(); |
|
212 | + $pluginTC = $view->get('twitterCard'); |
|
213 | + $pluginTC(); |
|
214 | 214 | }); |
215 | 215 | |
216 | 216 | |
217 | 217 | if (PHP_SAPI !== 'cli') { |
218 | - $session = new Container('facebook'); |
|
219 | - $fb = $e->getRequest()->getPost()->get('signed_request'); |
|
220 | - if ($fb) { |
|
218 | + $session = new Container('facebook'); |
|
219 | + $fb = $e->getRequest()->getPost()->get('signed_request'); |
|
220 | + if ($fb) { |
|
221 | 221 | $signedReq = explode('.', $fb, 2); |
222 | 222 | $payload = $signedReq[1]; |
223 | 223 | $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | // that they need to send the user back to FB... |
229 | 229 | |
230 | 230 | if (!count($_COOKIE) > 0 && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari')) { |
231 | - echo '<script type="text/javascript">' . |
|
231 | + echo '<script type="text/javascript">' . |
|
232 | 232 | 'window.top.location.href = window.location.href+"?redir_fb_page_id=' . $data["page"]["id"] . '";' . |
233 | 233 | '</script>'; |
234 | 234 | } |
@@ -236,129 +236,129 @@ discard block |
||
236 | 236 | // This fix exists only for IE6+, when this app is embedded into an iFrame : The P3P policy has to be set. |
237 | 237 | $response = $e->getResponse(); |
238 | 238 | if ($response instanceof \Laminas\Http\Response && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strpos($_SERVER['HTTP_USER_AGENT'], 'rv:11.'))) { |
239 | - $response->getHeaders()->addHeaderLine('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); |
|
239 | + $response->getHeaders()->addHeaderLine('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); |
|
240 | + } |
|
240 | 241 | } |
241 | - } |
|
242 | - |
|
243 | - // SECURITY HEADERS |
|
244 | - $headers = $e->getResponse()->getHeaders(); |
|
245 | - |
|
246 | - $headers->addHeaderLine('X-Content-Type-Options: nosniff'); |
|
247 | - // Not embeddable in an iframe TODO: make it configurable |
|
248 | - $headers->addHeaderLine('X-Frame-Options: sameorigin'); |
|
249 | - |
|
250 | - $headers->addHeaderLine('X-XSS-Protection: 1; mode=block'); |
|
251 | - $csp = new \Laminas\Http\Header\ContentSecurityPolicy(); |
|
252 | - //$csp->setDirective('default-src', array()) // No sources |
|
253 | - //$csp->setDirective('img-src', array('*')); |
|
254 | - // ->setDirective('object-src', array('media1.example.com', 'media2.example.com', '*.cdn.example.com')) |
|
255 | - // ->setDirective('script-src', array('trustedscripts.example.com')); |
|
256 | - $headers->addHeader($csp); |
|
242 | + |
|
243 | + // SECURITY HEADERS |
|
244 | + $headers = $e->getResponse()->getHeaders(); |
|
245 | + |
|
246 | + $headers->addHeaderLine('X-Content-Type-Options: nosniff'); |
|
247 | + // Not embeddable in an iframe TODO: make it configurable |
|
248 | + $headers->addHeaderLine('X-Frame-Options: sameorigin'); |
|
249 | + |
|
250 | + $headers->addHeaderLine('X-XSS-Protection: 1; mode=block'); |
|
251 | + $csp = new \Laminas\Http\Header\ContentSecurityPolicy(); |
|
252 | + //$csp->setDirective('default-src', array()) // No sources |
|
253 | + //$csp->setDirective('img-src', array('*')); |
|
254 | + // ->setDirective('object-src', array('media1.example.com', 'media2.example.com', '*.cdn.example.com')) |
|
255 | + // ->setDirective('script-src', array('trustedscripts.example.com')); |
|
256 | + $headers->addHeader($csp); |
|
257 | + } |
|
257 | 258 | } |
258 | - } |
|
259 | 259 | |
260 | - public function getConfig() |
|
261 | - { |
|
260 | + public function getConfig() |
|
261 | + { |
|
262 | 262 | return include __DIR__ . '/../config/module.config.php'; |
263 | - } |
|
263 | + } |
|
264 | 264 | |
265 | - public function getViewHelperConfig() |
|
266 | - { |
|
265 | + public function getViewHelperConfig() |
|
266 | + { |
|
267 | 267 | return array( |
268 | - 'factories' => array( |
|
268 | + 'factories' => array( |
|
269 | 269 | 'QgCKEditor' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
270 | - $config = $sm->get('config'); |
|
271 | - $QuCk = new View\Helper\AdCKEditor($config['playgroundcore']['ckeditor']); |
|
270 | + $config = $sm->get('config'); |
|
271 | + $QuCk = new View\Helper\AdCKEditor($config['playgroundcore']['ckeditor']); |
|
272 | 272 | |
273 | - return $QuCk; |
|
273 | + return $QuCk; |
|
274 | 274 | }, |
275 | 275 | |
276 | 276 | 'googleAnalytics' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
277 | - $tracker = $sm->get('PlaygroundCore\Analytics\Tracker'); |
|
277 | + $tracker = $sm->get('PlaygroundCore\Analytics\Tracker'); |
|
278 | 278 | |
279 | - $helper = new View\Helper\GoogleAnalytics($tracker, $sm->get('Request')); |
|
279 | + $helper = new View\Helper\GoogleAnalytics($tracker, $sm->get('Request')); |
|
280 | 280 | |
281 | - return $helper; |
|
281 | + return $helper; |
|
282 | 282 | }, |
283 | 283 | |
284 | 284 | 'facebookOpengraph' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
285 | - $tracker = $sm->get('facebook-opengraph'); |
|
285 | + $tracker = $sm->get('facebook-opengraph'); |
|
286 | 286 | |
287 | - $helper = new View\Helper\FacebookOpengraph($tracker, $sm->get('Request')); |
|
287 | + $helper = new View\Helper\FacebookOpengraph($tracker, $sm->get('Request')); |
|
288 | 288 | |
289 | - return $helper; |
|
289 | + return $helper; |
|
290 | 290 | }, |
291 | 291 | |
292 | 292 | 'twitterCard' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
293 | - $viewHelper = new View\Helper\TwitterCard(); |
|
294 | - $viewHelper->setConfig($sm->get('twitter-card')); |
|
295 | - $viewHelper->setRequest($sm->get('Request')); |
|
293 | + $viewHelper = new View\Helper\TwitterCard(); |
|
294 | + $viewHelper->setConfig($sm->get('twitter-card')); |
|
295 | + $viewHelper->setRequest($sm->get('Request')); |
|
296 | 296 | |
297 | - return $viewHelper; |
|
297 | + return $viewHelper; |
|
298 | 298 | }, |
299 | 299 | |
300 | 300 | 'switchLocaleWidget' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
301 | - $viewHelper = new View\Helper\SwitchLocaleWidget(); |
|
302 | - $viewHelper->setLocaleService($sm->get('playgroundcore_locale_service')); |
|
303 | - $viewHelper->setWebsiteService($sm->get('playgroundcore_website_service')); |
|
304 | - $viewHelper->setRouteMatch($sm->get('Application')->getMvcEvent()->getRouteMatch()); |
|
301 | + $viewHelper = new View\Helper\SwitchLocaleWidget(); |
|
302 | + $viewHelper->setLocaleService($sm->get('playgroundcore_locale_service')); |
|
303 | + $viewHelper->setWebsiteService($sm->get('playgroundcore_website_service')); |
|
304 | + $viewHelper->setRouteMatch($sm->get('Application')->getMvcEvent()->getRouteMatch()); |
|
305 | 305 | |
306 | - return $viewHelper; |
|
306 | + return $viewHelper; |
|
307 | 307 | }, |
308 | 308 | |
309 | 309 | 'countryName' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
310 | - $service = $sm->get('playgroundcore_country_service'); |
|
311 | - $viewHelper = new View\Helper\CountryName($service); |
|
310 | + $service = $sm->get('playgroundcore_country_service'); |
|
311 | + $viewHelper = new View\Helper\CountryName($service); |
|
312 | 312 | |
313 | - return $viewHelper; |
|
313 | + return $viewHelper; |
|
314 | 314 | }, |
315 | - ), |
|
315 | + ), |
|
316 | 316 | ); |
317 | - } |
|
317 | + } |
|
318 | 318 | |
319 | - public function getServiceConfig() |
|
320 | - { |
|
319 | + public function getServiceConfig() |
|
320 | + { |
|
321 | 321 | return array( |
322 | 322 | |
323 | - 'shared' => array( |
|
323 | + 'shared' => array( |
|
324 | 324 | 'playgroundcore_message' => false, |
325 | 325 | // don't want this service to be a singleton. I have to reset the ffmpeg parameters for each call. |
326 | 326 | 'playgroundcore_ffmpeg_service' => false |
327 | - ), |
|
327 | + ), |
|
328 | 328 | |
329 | - 'factories' => array( |
|
329 | + 'factories' => array( |
|
330 | 330 | 'playgroundcore_module_options' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
331 | - $config = $sm->get('Configuration'); |
|
331 | + $config = $sm->get('Configuration'); |
|
332 | 332 | |
333 | - return new Options\ModuleOptions(isset($config['playgroundcore']) ? $config['playgroundcore'] : array()); |
|
333 | + return new Options\ModuleOptions(isset($config['playgroundcore']) ? $config['playgroundcore'] : array()); |
|
334 | 334 | }, |
335 | 335 | |
336 | 336 | 'playgroundcore_formgen_mapper' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
337 | - return new Mapper\Formgen( |
|
337 | + return new Mapper\Formgen( |
|
338 | 338 | $sm->get('playgroundcore_doctrine_em'), |
339 | 339 | $sm->get('playgroundcore_module_options'), |
340 | 340 | $sm |
341 | - ); |
|
341 | + ); |
|
342 | 342 | }, |
343 | 343 | |
344 | 344 | 'playgroundcore_website_mapper' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
345 | 345 | |
346 | - return new Mapper\Website( |
|
346 | + return new Mapper\Website( |
|
347 | 347 | $sm->get('playgroundcore_doctrine_em'), |
348 | 348 | $sm->get('playgroundcore_module_options'), |
349 | 349 | $sm |
350 | - ); |
|
350 | + ); |
|
351 | 351 | }, |
352 | 352 | |
353 | 353 | 'playgroundcore_locale_mapper' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
354 | - return new Mapper\Locale( |
|
354 | + return new Mapper\Locale( |
|
355 | 355 | $sm->get('playgroundcore_doctrine_em'), |
356 | 356 | $sm->get('playgroundcore_module_options'), |
357 | 357 | $sm |
358 | - ); |
|
358 | + ); |
|
359 | 359 | }, |
360 | 360 | 'PlaygroundCore\Analytics\Tracker' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
361 | - return new Analytics\Tracker($sm->get('playgrounddesign_company_mapper')); |
|
361 | + return new Analytics\Tracker($sm->get('playgrounddesign_company_mapper')); |
|
362 | 362 | }, |
363 | 363 | // DEPRECATED |
364 | 364 | // 'PlaygroundCore\Analytics\Tracker' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
@@ -397,37 +397,37 @@ discard block |
||
397 | 397 | // return $tracker; |
398 | 398 | // }, |
399 | 399 | 'PlaygroundCore\Opengraph\Tracker' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
400 | - $config = $sm->get('config'); |
|
401 | - $config = isset($config['playgroundcore']['facebookOpengraph']) ? $config['playgroundcore']['facebookOpengraph'] : array('appId' => ''); |
|
400 | + $config = $sm->get('config'); |
|
401 | + $config = isset($config['playgroundcore']['facebookOpengraph']) ? $config['playgroundcore']['facebookOpengraph'] : array('appId' => ''); |
|
402 | 402 | |
403 | - $tracker = new Opengraph\Tracker($config['appId']); |
|
403 | + $tracker = new Opengraph\Tracker($config['appId']); |
|
404 | 404 | |
405 | - if (isset($config['enable'])) { |
|
405 | + if (isset($config['enable'])) { |
|
406 | 406 | $tracker->setEnableOpengraph($config['enable']); |
407 | - } |
|
407 | + } |
|
408 | 408 | |
409 | - if (isset($config['tags'])) { |
|
409 | + if (isset($config['tags'])) { |
|
410 | 410 | foreach ($config['tags'] as $type => $value) { |
411 | - $tag = new Opengraph\Tag($type, $value); |
|
412 | - $tracker->addTag($tag); |
|
411 | + $tag = new Opengraph\Tag($type, $value); |
|
412 | + $tracker->addTag($tag); |
|
413 | + } |
|
413 | 414 | } |
414 | - } |
|
415 | 415 | |
416 | - return $tracker; |
|
416 | + return $tracker; |
|
417 | 417 | }, |
418 | 418 | 'PlaygroundCore\TwitterCard\Config' => function (\Laminas\ServiceManager\ServiceManager $sm) { |
419 | - $config = $sm->get('config'); |
|
420 | - $config = isset($config['playgroundcore']['twitterCard']) ? $config['playgroundcore']['twitterCard'] : array(); |
|
421 | - return new TwitterCard\Config($config); |
|
419 | + $config = $sm->get('config'); |
|
420 | + $config = isset($config['playgroundcore']['twitterCard']) ? $config['playgroundcore']['twitterCard'] : array(); |
|
421 | + return new TwitterCard\Config($config); |
|
422 | 422 | }, |
423 | - ), |
|
423 | + ), |
|
424 | 424 | ); |
425 | - } |
|
425 | + } |
|
426 | 426 | |
427 | - public function getConsoleUsage(\Laminas\Console\Adapter\Posix $console) |
|
428 | - { |
|
427 | + public function getConsoleUsage(\Laminas\Console\Adapter\Posix $console) |
|
428 | + { |
|
429 | 429 | return array( |
430 | - 'cron' => 'call this command to enable cron tasks' |
|
430 | + 'cron' => 'call this command to enable cron tasks' |
|
431 | 431 | ); |
432 | - } |
|
432 | + } |
|
433 | 433 | } |