@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider()); |
| 161 | 161 | $this->register(new MobileDetectServiceProvider()); |
| 162 | 162 | |
| 163 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
| 163 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
| 164 | 164 | if ($this['debug']) { |
| 165 | 165 | return; |
| 166 | 166 | } |
@@ -254,14 +254,14 @@ discard block |
||
| 254 | 254 | return $router; |
| 255 | 255 | }); |
| 256 | 256 | |
| 257 | - $this['eccube.router.origin'] = function ($app) { |
|
| 257 | + $this['eccube.router.origin'] = function($app) { |
|
| 258 | 258 | $resource = __DIR__.'/Controller'; |
| 259 | 259 | $cachePrefix = 'Origin'; |
| 260 | 260 | |
| 261 | 261 | return $app['eccube.router']($resource, $cachePrefix); |
| 262 | 262 | }; |
| 263 | 263 | |
| 264 | - $this['eccube.routers.plugin'] = function ($app) { |
|
| 264 | + $this['eccube.routers.plugin'] = function($app) { |
|
| 265 | 265 | // TODO 有効なプラグインを対象とする必要がある. |
| 266 | 266 | $dirs = Finder::create() |
| 267 | 267 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | return $routers; |
| 279 | 279 | }; |
| 280 | 280 | |
| 281 | - $this['eccube.router.extend'] = function ($app) { |
|
| 281 | + $this['eccube.router.extend'] = function($app) { |
|
| 282 | 282 | // TODO ディレクトリ名は暫定 |
| 283 | 283 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
| 284 | 284 | $cachePrefix = 'Extend'; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | return $router; |
| 289 | 289 | }; |
| 290 | 290 | |
| 291 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
| 291 | + $this->extend('request_matcher', function($matcher, $app) { |
|
| 292 | 292 | $matchers = []; |
| 293 | 293 | $matchers[] = $app['eccube.router.extend']; |
| 294 | 294 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | return new ChainUrlMatcher($matchers, $app['request_context']); |
| 301 | 301 | }); |
| 302 | 302 | |
| 303 | - $this->extend('url_generator', function ($generator, $app) { |
|
| 303 | + $this->extend('url_generator', function($generator, $app) { |
|
| 304 | 304 | $generators = []; |
| 305 | 305 | $generators[] = $app['eccube.router.extend']; |
| 306 | 306 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
| 332 | 332 | 'locale_fallbacks' => ['ja', 'en'], |
| 333 | 333 | )); |
| 334 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 334 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 335 | 335 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 336 | 336 | |
| 337 | 337 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -378,14 +378,14 @@ discard block |
||
| 378 | 378 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 379 | 379 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 380 | 380 | )); |
| 381 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 381 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 382 | 382 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 383 | 383 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 384 | 384 | |
| 385 | 385 | return $twig; |
| 386 | 386 | }); |
| 387 | 387 | |
| 388 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 388 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 389 | 389 | $app['admin'] = $app['front'] = false; |
| 390 | 390 | $pathinfo = rawurldecode($request->getPathInfo()); |
| 391 | 391 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | $paths[] = $app['config']['template_admin_realdir']; |
| 403 | 403 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 404 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 404 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 405 | 405 | } else { |
| 406 | 406 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
| 407 | 407 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | $paths[] = $app['config']['template_default_realdir']; |
| 418 | 418 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 419 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 419 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 420 | 420 | } |
| 421 | 421 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
| 422 | 422 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | }, self::EARLY_EVENT); |
| 435 | 435 | |
| 436 | 436 | // twigのグローバル変数を定義. |
| 437 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 437 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 438 | 438 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
| 439 | 439 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
| 440 | 440 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 521 | 521 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 522 | 522 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 523 | - \Swift::init(function () { |
|
| 523 | + \Swift::init(function() { |
|
| 524 | 524 | \Swift_DependencyContainer::getInstance() |
| 525 | 525 | ->register('mime.qpheaderencoder') |
| 526 | 526 | ->asAliasOf('mime.base64headerencoder'); |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
| 556 | 556 | |
| 557 | 557 | $app = $this; |
| 558 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
| 558 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
| 559 | 559 | $initSubscriber = new InitSubscriber($app); |
| 560 | 560 | $evm->addEventSubscriber($initSubscriber); |
| 561 | 561 | |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | |
| 651 | 651 | $this->extend( |
| 652 | 652 | 'orm.em.config', |
| 653 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 653 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 654 | 654 | |
| 655 | 655 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
| 656 | 656 | $chain = $config->getMetadataDriverImpl(); |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | } |
| 673 | 673 | ); |
| 674 | 674 | |
| 675 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 675 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 676 | 676 | // tax_rule |
| 677 | 677 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
| 678 | 678 | $taxRuleRepository->setApplication($app); |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | // second level cacheの設定. |
| 702 | 702 | $this->extend( |
| 703 | 703 | 'orm.em.config', |
| 704 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 704 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 705 | 705 | $config->setSecondLevelCacheEnabled(); |
| 706 | 706 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
| 707 | 707 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -790,31 +790,31 @@ discard block |
||
| 790 | 790 | array('^/mypage', 'ROLE_USER', $channel), |
| 791 | 791 | ); |
| 792 | 792 | |
| 793 | - $this['eccube.password_encoder'] = function ($app) { |
|
| 793 | + $this['eccube.password_encoder'] = function($app) { |
|
| 794 | 794 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
| 795 | 795 | }; |
| 796 | - $this['security.encoder_factory'] = function ($app) { |
|
| 796 | + $this['security.encoder_factory'] = function($app) { |
|
| 797 | 797 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
| 798 | 798 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
| 799 | 799 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
| 800 | 800 | )); |
| 801 | 801 | }; |
| 802 | - $this['eccube.event_listner.security'] = function ($app) { |
|
| 802 | + $this['eccube.event_listner.security'] = function($app) { |
|
| 803 | 803 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
| 804 | 804 | }; |
| 805 | 805 | |
| 806 | 806 | // Voterの設定 |
| 807 | - $this['authority_voter'] = function ($app) { |
|
| 807 | + $this['authority_voter'] = function($app) { |
|
| 808 | 808 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
| 809 | 809 | }; |
| 810 | 810 | |
| 811 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
| 811 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
| 812 | 812 | $voters[] = $app['authority_voter']; |
| 813 | 813 | |
| 814 | 814 | return $voters; |
| 815 | 815 | }); |
| 816 | 816 | |
| 817 | - $this['security.access_manager'] = function ($app) { |
|
| 817 | + $this['security.access_manager'] = function($app) { |
|
| 818 | 818 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
| 819 | 819 | }; |
| 820 | 820 | |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | { |
| 829 | 829 | $config = $this['config']; |
| 830 | 830 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
| 831 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
| 831 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
| 832 | 832 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
| 833 | 833 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
| 834 | 834 | }, self::EARLY_EVENT); |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | $app = $this; |
| 995 | 995 | |
| 996 | 996 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 997 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 997 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 998 | 998 | |
| 999 | 999 | if (!$event->isMasterRequest()) { |
| 1000 | 1000 | return; |