@@ -16,7 +16,7 @@ |
||
16 | 16 | return new \Mobile_Detect(); |
17 | 17 | }; |
18 | 18 | |
19 | - $app['mobile_detect.device_type'] = function ($app) { |
|
19 | + $app['mobile_detect.device_type'] = function($app) { |
|
20 | 20 | if ($app['mobile_detect']->isMobile()) { |
21 | 21 | return \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP; |
22 | 22 | } else { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->register(new \Silex\Provider\ValidatorServiceProvider()); |
166 | 166 | $this->register(new MobileDetectServiceProvider()); |
167 | 167 | |
168 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
168 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
169 | 169 | if ($this['debug']) { |
170 | 170 | return; |
171 | 171 | } |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | return $router; |
260 | 260 | }); |
261 | 261 | |
262 | - $this['eccube.router.origin'] = function ($app) { |
|
262 | + $this['eccube.router.origin'] = function($app) { |
|
263 | 263 | $resource = __DIR__.'/Controller'; |
264 | 264 | $cachePrefix = 'Origin'; |
265 | 265 | |
266 | 266 | return $app['eccube.router']($resource, $cachePrefix); |
267 | 267 | }; |
268 | 268 | |
269 | - $this['eccube.routers.plugin'] = function ($app) { |
|
269 | + $this['eccube.routers.plugin'] = function($app) { |
|
270 | 270 | // TODO 有効なプラグインを対象とする必要がある. |
271 | 271 | $dirs = Finder::create() |
272 | 272 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | return $routers; |
284 | 284 | }; |
285 | 285 | |
286 | - $this['eccube.router.extend'] = function ($app) { |
|
286 | + $this['eccube.router.extend'] = function($app) { |
|
287 | 287 | // TODO ディレクトリ名は暫定 |
288 | 288 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
289 | 289 | $cachePrefix = 'Extend'; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | return $router; |
294 | 294 | }; |
295 | 295 | |
296 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
296 | + $this->extend('request_matcher', function($matcher, $app) { |
|
297 | 297 | $matchers = []; |
298 | 298 | $matchers[] = $app['eccube.router.extend']; |
299 | 299 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | return new ChainUrlMatcher($matchers, $app['request_context']); |
306 | 306 | }); |
307 | 307 | |
308 | - $this->extend('url_generator', function ($generator, $app) { |
|
308 | + $this->extend('url_generator', function($generator, $app) { |
|
309 | 309 | $generators = []; |
310 | 310 | $generators[] = $app['eccube.router.extend']; |
311 | 311 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
337 | 337 | 'locale_fallbacks' => ['ja', 'en'], |
338 | 338 | )); |
339 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
339 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
340 | 340 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
341 | 341 | |
342 | 342 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
384 | 384 | 'twig.form.templates' => array('Form/form_layout.twig'), |
385 | 385 | )); |
386 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
386 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
387 | 387 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
388 | 388 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
389 | 389 | |
390 | 390 | return $twig; |
391 | 391 | }); |
392 | 392 | |
393 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
393 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
394 | 394 | $app['admin'] = $app['front'] = false; |
395 | 395 | $pathinfo = rawurldecode($request->getPathInfo()); |
396 | 396 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | } |
407 | 407 | $paths[] = $app['config']['template_admin_realdir']; |
408 | 408 | $paths[] = __DIR__.'/../../app/Plugin'; |
409 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
409 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
410 | 410 | } else { |
411 | 411 | switch ($app['mobile_detect.device_type']) { |
412 | 412 | case \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP: |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | $paths[] = __DIR__.'/Resource/template/smartphone'; |
418 | 418 | $paths[] = __DIR__.'/../../app/Plugin'; |
419 | - $cacheDir = __DIR__.'/../../app/cache/twig/smartphone'; |
|
419 | + $cacheDir = __DIR__.'/../../app/cache/twig/smartphone'; |
|
420 | 420 | // $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
421 | 421 | default: |
422 | 422 | case \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_PC: |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | } |
426 | 426 | $paths[] = $app['config']['template_default_realdir']; |
427 | 427 | $paths[] = __DIR__.'/../../app/Plugin'; |
428 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
428 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | }, self::EARLY_EVENT); |
445 | 445 | |
446 | 446 | // twigのグローバル変数を定義. |
447 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
447 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
448 | 448 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
449 | 449 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
450 | 450 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
512 | 512 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
513 | 513 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
514 | - \Swift::init(function () { |
|
514 | + \Swift::init(function() { |
|
515 | 515 | \Swift_DependencyContainer::getInstance() |
516 | 516 | ->register('mime.qpheaderencoder') |
517 | 517 | ->asAliasOf('mime.base64headerencoder'); |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | ), |
641 | 641 | )); |
642 | 642 | |
643 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
643 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
644 | 644 | // tax_rule |
645 | 645 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
646 | 646 | $taxRuleRepository->setApplication($app); |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | // second level cacheの設定. |
674 | 674 | $this->extend( |
675 | 675 | 'orm.em.config', |
676 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
676 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
677 | 677 | $config->setSecondLevelCacheEnabled(); |
678 | 678 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
679 | 679 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -762,31 +762,31 @@ discard block |
||
762 | 762 | array('^/mypage', 'ROLE_USER', $channel), |
763 | 763 | ); |
764 | 764 | |
765 | - $this['eccube.password_encoder'] = function ($app) { |
|
765 | + $this['eccube.password_encoder'] = function($app) { |
|
766 | 766 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
767 | 767 | }; |
768 | - $this['security.encoder_factory'] = function ($app) { |
|
768 | + $this['security.encoder_factory'] = function($app) { |
|
769 | 769 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
770 | 770 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
771 | 771 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
772 | 772 | )); |
773 | 773 | }; |
774 | - $this['eccube.event_listner.security'] = function ($app) { |
|
774 | + $this['eccube.event_listner.security'] = function($app) { |
|
775 | 775 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
776 | 776 | }; |
777 | 777 | |
778 | 778 | // Voterの設定 |
779 | - $this['authority_voter'] = function ($app) { |
|
779 | + $this['authority_voter'] = function($app) { |
|
780 | 780 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
781 | 781 | }; |
782 | 782 | |
783 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
783 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
784 | 784 | $voters[] = $app['authority_voter']; |
785 | 785 | |
786 | 786 | return $voters; |
787 | 787 | }); |
788 | 788 | |
789 | - $this['security.access_manager'] = function ($app) { |
|
789 | + $this['security.access_manager'] = function($app) { |
|
790 | 790 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
791 | 791 | }; |
792 | 792 | |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | { |
801 | 801 | $config = $this['config']; |
802 | 802 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
803 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
803 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
804 | 804 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
805 | 805 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
806 | 806 | }, self::EARLY_EVENT); |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $app = $this; |
967 | 967 | |
968 | 968 | // Response Event(http cache対応、event実行は一番遅く設定) |
969 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
969 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
970 | 970 | |
971 | 971 | if (!$event->isMasterRequest()) { |
972 | 972 | return; |