@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace Eccube; |
25 | 25 | |
26 | -use Composer\Autoload\ClassLoader; |
|
27 | 26 | use Doctrine\DBAL\Types\Type; |
28 | 27 | use Eccube\Di\Scanner\ComponentScanner; |
29 | 28 | use Eccube\Di\Scanner\EntityEventScanner; |
@@ -656,13 +656,13 @@ |
||
656 | 656 | $pluginConfigs = PluginConfigManager::getPluginConfigAll($this['debug']); |
657 | 657 | $ormMappings = array(); |
658 | 658 | $ormMappings[] = array( |
659 | - 'type' => 'annotation', |
|
660 | - 'namespace' => 'Eccube\Entity', |
|
661 | - 'path' => array( |
|
662 | - __DIR__.'/Entity' |
|
663 | - ), |
|
664 | - 'use_simple_annotation_reader' => false, |
|
665 | - ); |
|
659 | + 'type' => 'annotation', |
|
660 | + 'namespace' => 'Eccube\Entity', |
|
661 | + 'path' => array( |
|
662 | + __DIR__.'/Entity' |
|
663 | + ), |
|
664 | + 'use_simple_annotation_reader' => false, |
|
665 | + ); |
|
666 | 666 | |
667 | 667 | if (isset($this['config']['vendor_dir'])) { |
668 | 668 | $ormMappings[] = array( |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $this->register(new MobileDetectServiceProvider()); |
207 | 207 | $this->register(new TwigLintServiceProvider()); |
208 | 208 | |
209 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
209 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
210 | 210 | if ($this['debug']) { |
211 | 211 | return; |
212 | 212 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $pluginSubDirs = (function($dirName) use ($enabledPluginDirs) { |
275 | 275 | return array_map(function($pluginDir) use ($dirName) { |
276 | - return $pluginDir . '/' . $dirName; |
|
276 | + return $pluginDir.'/'.$dirName; |
|
277 | 277 | }, $enabledPluginDirs); |
278 | 278 | }); |
279 | 279 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | return $router; |
341 | 341 | }); |
342 | 342 | |
343 | - $this['eccube.router.origin'] = function ($app) { |
|
343 | + $this['eccube.router.origin'] = function($app) { |
|
344 | 344 | $resource = __DIR__.'/Controller'; |
345 | 345 | $cachePrefix = 'Origin'; |
346 | 346 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $this['eccube.routers.plugin'] = []; |
351 | 351 | |
352 | 352 | if (isset($this['config']['vendor_dir'])) { |
353 | - $this['eccube.router.extend'] = function ($app) { |
|
353 | + $this['eccube.router.extend'] = function($app) { |
|
354 | 354 | $resource = $app['config']['vendor_dir'].'/Controller'; |
355 | 355 | $cachePrefix = 'Extend'; |
356 | 356 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | return $router; |
360 | 360 | }; |
361 | 361 | } |
362 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
362 | + $this->extend('request_matcher', function($matcher, $app) { |
|
363 | 363 | $matchers = []; |
364 | 364 | if (isset($app['config']['vendor_dir'])) { |
365 | 365 | $matchers[] = $app['eccube.router.extend']; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | return new ChainUrlMatcher($matchers, $app['request_context']); |
374 | 374 | }); |
375 | 375 | |
376 | - $this->extend('url_generator', function ($generator, $app) { |
|
376 | + $this->extend('url_generator', function($generator, $app) { |
|
377 | 377 | $generators = []; |
378 | 378 | $generators[] = $app['eccube.router.extend']; |
379 | 379 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | }); |
387 | 387 | |
388 | 388 | // Route CollectionにEC-CUBEで定義したルーティングを追加(debug tool barに出力するため) |
389 | - $this->extend('routes', function ($routes, $app) { |
|
389 | + $this->extend('routes', function($routes, $app) { |
|
390 | 390 | $routes->addCollection($app['eccube.router.extend']->getRouteCollection()); |
391 | 391 | foreach ($app['eccube.routers.plugin'] as $router) { |
392 | 392 | $routes->addCollection($router->getRouteCollection()); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
420 | 420 | 'locale_fallbacks' => ['ja', 'en'], |
421 | 421 | )); |
422 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
422 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
423 | 423 | $translator->addLoader('php', new \Symfony\Component\Translation\Loader\PhpFileLoader()); |
424 | 424 | |
425 | 425 | $file = __DIR__.'/Resource/locale/messages.'.$app['locale'].'.php'; |
@@ -462,14 +462,14 @@ discard block |
||
462 | 462 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
463 | 463 | 'twig.form.templates' => array('Form/form_layout.twig'), |
464 | 464 | )); |
465 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
465 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
466 | 466 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
467 | 467 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
468 | 468 | |
469 | 469 | return $twig; |
470 | 470 | }); |
471 | 471 | |
472 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
472 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
473 | 473 | $app['admin'] = $app['front'] = false; |
474 | 474 | $pathinfo = rawurldecode($request->getPathInfo()); |
475 | 475 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | } |
486 | 486 | $paths[] = $app['config']['template_admin_realdir']; |
487 | 487 | $paths[] = __DIR__.'/../../app/Plugin'; |
488 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
488 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
489 | 489 | } else { |
490 | 490 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
491 | 491 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } |
501 | 501 | $paths[] = $app['config']['template_default_realdir']; |
502 | 502 | $paths[] = __DIR__.'/../../app/Plugin'; |
503 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
503 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
504 | 504 | } |
505 | 505 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
506 | 506 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | }, self::EARLY_EVENT); |
519 | 519 | |
520 | 520 | // twigのグローバル変数を定義. |
521 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
521 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
522 | 522 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
523 | 523 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
524 | 524 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
604 | 604 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
605 | 605 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
606 | - \Swift::init(function () { |
|
606 | + \Swift::init(function() { |
|
607 | 607 | \Swift_DependencyContainer::getInstance() |
608 | 608 | ->register('mime.qpheaderencoder') |
609 | 609 | ->asAliasOf('mime.base64headerencoder'); |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
639 | 639 | |
640 | 640 | $app = $this; |
641 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
641 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
642 | 642 | $initSubscriber = new InitSubscriber($app); |
643 | 643 | $evm->addEventSubscriber($initSubscriber); |
644 | 644 | |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | |
755 | 755 | $this->extend( |
756 | 756 | 'orm.em.config', |
757 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
757 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
758 | 758 | |
759 | 759 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
760 | 760 | $chain = $config->getMetadataDriverImpl(); |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | } |
777 | 777 | ); |
778 | 778 | |
779 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
779 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
780 | 780 | // save |
781 | 781 | $saveEventSubscriber = new \Eccube\Doctrine\EventSubscriber\SaveEventSubscriber($app); |
782 | 782 | $em->getEventManager()->addEventSubscriber($saveEventSubscriber); |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | // second level cacheの設定. |
802 | 802 | $this->extend( |
803 | 803 | 'orm.em.config', |
804 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
804 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
805 | 805 | $config->setSecondLevelCacheEnabled(); |
806 | 806 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
807 | 807 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -890,31 +890,31 @@ discard block |
||
890 | 890 | array('^/mypage', 'ROLE_USER', $channel), |
891 | 891 | ); |
892 | 892 | |
893 | - $this['eccube.password_encoder'] = function ($app) { |
|
893 | + $this['eccube.password_encoder'] = function($app) { |
|
894 | 894 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
895 | 895 | }; |
896 | - $this['security.encoder_factory'] = function ($app) { |
|
896 | + $this['security.encoder_factory'] = function($app) { |
|
897 | 897 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
898 | 898 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
899 | 899 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
900 | 900 | )); |
901 | 901 | }; |
902 | - $this['eccube.event_listner.security'] = function ($app) { |
|
902 | + $this['eccube.event_listner.security'] = function($app) { |
|
903 | 903 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
904 | 904 | }; |
905 | 905 | |
906 | 906 | // Voterの設定 |
907 | - $this['authority_voter'] = function ($app) { |
|
907 | + $this['authority_voter'] = function($app) { |
|
908 | 908 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
909 | 909 | }; |
910 | 910 | |
911 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
911 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
912 | 912 | $voters[] = $app['authority_voter']; |
913 | 913 | |
914 | 914 | return $voters; |
915 | 915 | }); |
916 | 916 | |
917 | - $this['security.access_manager'] = function ($app) { |
|
917 | + $this['security.access_manager'] = function($app) { |
|
918 | 918 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
919 | 919 | }; |
920 | 920 | |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | { |
929 | 929 | $config = $this['config']; |
930 | 930 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
931 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
931 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
932 | 932 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
933 | 933 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
934 | 934 | }, self::EARLY_EVENT); |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | $this->register(new ServiceProvider\EccubePluginServiceProvider()); |
946 | 946 | |
947 | 947 | // TODO Acme\ServiceProvider の初期化はここで OK? |
948 | - if (array_key_exists('service',$this['config'])) { |
|
948 | + if (array_key_exists('service', $this['config'])) { |
|
949 | 949 | foreach ($this['config']['service'] as $service) { |
950 | 950 | $this->register(new $service); |
951 | 951 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | $app = $this; |
1088 | 1088 | |
1089 | 1089 | // Response Event(http cache対応、event実行は一番遅く設定) |
1090 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1090 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1091 | 1091 | |
1092 | 1092 | if (!$event->isMasterRequest()) { |
1093 | 1093 | return; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $loader = require __DIR__.'/autoload.php'; |
26 | 26 | |
27 | 27 | ini_set('display_errors', 'Off'); |
28 | -error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); |
|
28 | +error_reporting(E_ALL&~E_DEPRECATED&~E_STRICT); |
|
29 | 29 | |
30 | 30 | // see http://silex.sensiolabs.org/doc/web_servers.html#php-5-4 |
31 | 31 | $filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']); |
@@ -52,7 +52,7 @@ |
||
52 | 52 | }, $app[PluginRepository::class]->findAllEnabled()); |
53 | 53 | |
54 | 54 | $entityProxyService->generate( |
55 | - array_merge([$this['config']['vendor_dir'].'/Entity',], $dirs), |
|
55 | + array_merge([$this['config']['vendor_dir'].'/Entity', ], $dirs), |
|
56 | 56 | $app['config']['root_dir'].'/app/proxy/entity', |
57 | 57 | $output |
58 | 58 | ); |