@@ -4,25 +4,17 @@ |
||
4 | 4 | |
5 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | 6 | use Eccube\Application; |
7 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
|
8 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
9 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
10 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
11 | 10 | use Symfony\Component\HttpFoundation\Request; |
12 | - |
|
13 | -use Eccube\Common\Constant; |
|
14 | -use Eccube\Controller\AbstractController; |
|
15 | 11 | use Eccube\Entity\Shipping; |
16 | -use Eccube\Entity\Master\CsvType; |
|
17 | 12 | use Eccube\Event\EccubeEvents; |
18 | 13 | use Eccube\Event\EventArgs; |
19 | -use Eccube\Form\Type\AddCartType; |
|
20 | -use Eccube\Form\Type\Admin\SearchOrderType; |
|
21 | 14 | use Eccube\Form\Type\Admin\ShippingType; |
22 | 15 | use Eccube\Form\Type\Admin\SearchCustomerType; |
23 | 16 | use Eccube\Form\Type\Admin\SearchProductType; |
24 | 17 | use Eccube\Form\Type\Admin\ShipmentItemType; |
25 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
26 | 18 | |
27 | 19 | /** |
28 | 20 | * @Route("/{_admin}/shipping") |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider()); |
168 | 168 | $this->register(new MobileDetectServiceProvider()); |
169 | 169 | |
170 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
170 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
171 | 171 | if ($this['debug']) { |
172 | 172 | return; |
173 | 173 | } |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | return $router; |
262 | 262 | }); |
263 | 263 | |
264 | - $this['eccube.router.origin'] = function ($app) { |
|
264 | + $this['eccube.router.origin'] = function($app) { |
|
265 | 265 | $resource = __DIR__.'/Controller'; |
266 | 266 | $cachePrefix = 'Origin'; |
267 | 267 | |
268 | 268 | return $app['eccube.router']($resource, $cachePrefix); |
269 | 269 | }; |
270 | 270 | |
271 | - $this['eccube.routers.plugin'] = function ($app) { |
|
271 | + $this['eccube.routers.plugin'] = function($app) { |
|
272 | 272 | // TODO 有効なプラグインを対象とする必要がある. |
273 | 273 | $dirs = Finder::create() |
274 | 274 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | return $routers; |
286 | 286 | }; |
287 | 287 | |
288 | - $this['eccube.router.extend'] = function ($app) { |
|
288 | + $this['eccube.router.extend'] = function($app) { |
|
289 | 289 | // TODO ディレクトリ名は暫定 |
290 | 290 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
291 | 291 | $cachePrefix = 'Extend'; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | return $router; |
296 | 296 | }; |
297 | 297 | |
298 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
298 | + $this->extend('request_matcher', function($matcher, $app) { |
|
299 | 299 | $matchers = []; |
300 | 300 | $matchers[] = $app['eccube.router.extend']; |
301 | 301 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | return new ChainUrlMatcher($matchers, $app['request_context']); |
308 | 308 | }); |
309 | 309 | |
310 | - $this->extend('url_generator', function ($generator, $app) { |
|
310 | + $this->extend('url_generator', function($generator, $app) { |
|
311 | 311 | $generators = []; |
312 | 312 | $generators[] = $app['eccube.router.extend']; |
313 | 313 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | }); |
321 | 321 | |
322 | 322 | // Route CollectionにEC-CUBEで定義したルーティングを追加(debug tool barに出力するため) |
323 | - $this->extend('routes', function ($routes, $app) { |
|
323 | + $this->extend('routes', function($routes, $app) { |
|
324 | 324 | $routes->addCollection($app['eccube.router.extend']->getRouteCollection()); |
325 | 325 | foreach ($app['eccube.routers.plugin'] as $router) { |
326 | 326 | $routes->addCollection($router->getRouteCollection()); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
350 | 350 | 'locale_fallbacks' => ['ja', 'en'], |
351 | 351 | )); |
352 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
352 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
353 | 353 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
354 | 354 | |
355 | 355 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
397 | 397 | 'twig.form.templates' => array('Form/form_layout.twig'), |
398 | 398 | )); |
399 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
399 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
400 | 400 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
401 | 401 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
402 | 402 | |
403 | 403 | return $twig; |
404 | 404 | }); |
405 | 405 | |
406 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
406 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
407 | 407 | $app['admin'] = $app['front'] = false; |
408 | 408 | $pathinfo = rawurldecode($request->getPathInfo()); |
409 | 409 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } |
420 | 420 | $paths[] = $app['config']['template_admin_realdir']; |
421 | 421 | $paths[] = __DIR__.'/../../app/Plugin'; |
422 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
422 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
423 | 423 | } else { |
424 | 424 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
425 | 425 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | } |
435 | 435 | $paths[] = $app['config']['template_default_realdir']; |
436 | 436 | $paths[] = __DIR__.'/../../app/Plugin'; |
437 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
437 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
438 | 438 | } |
439 | 439 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
440 | 440 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | }, self::EARLY_EVENT); |
453 | 453 | |
454 | 454 | // twigのグローバル変数を定義. |
455 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
455 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
456 | 456 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
457 | 457 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
458 | 458 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
539 | 539 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
540 | 540 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
541 | - \Swift::init(function () { |
|
541 | + \Swift::init(function() { |
|
542 | 542 | \Swift_DependencyContainer::getInstance() |
543 | 543 | ->register('mime.qpheaderencoder') |
544 | 544 | ->asAliasOf('mime.base64headerencoder'); |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
574 | 574 | |
575 | 575 | $app = $this; |
576 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
576 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
577 | 577 | $initSubscriber = new InitSubscriber($app); |
578 | 578 | $evm->addEventSubscriber($initSubscriber); |
579 | 579 | |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | |
669 | 669 | $this->extend( |
670 | 670 | 'orm.em.config', |
671 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
671 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
672 | 672 | |
673 | 673 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
674 | 674 | $chain = $config->getMetadataDriverImpl(); |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | } |
691 | 691 | ); |
692 | 692 | |
693 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
693 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
694 | 694 | // tax_rule |
695 | 695 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
696 | 696 | $taxRuleRepository->setApplication($app); |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | // second level cacheの設定. |
720 | 720 | $this->extend( |
721 | 721 | 'orm.em.config', |
722 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
722 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
723 | 723 | $config->setSecondLevelCacheEnabled(); |
724 | 724 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
725 | 725 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -808,31 +808,31 @@ discard block |
||
808 | 808 | array('^/mypage', 'ROLE_USER', $channel), |
809 | 809 | ); |
810 | 810 | |
811 | - $this['eccube.password_encoder'] = function ($app) { |
|
811 | + $this['eccube.password_encoder'] = function($app) { |
|
812 | 812 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
813 | 813 | }; |
814 | - $this['security.encoder_factory'] = function ($app) { |
|
814 | + $this['security.encoder_factory'] = function($app) { |
|
815 | 815 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
816 | 816 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
817 | 817 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
818 | 818 | )); |
819 | 819 | }; |
820 | - $this['eccube.event_listner.security'] = function ($app) { |
|
820 | + $this['eccube.event_listner.security'] = function($app) { |
|
821 | 821 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
822 | 822 | }; |
823 | 823 | |
824 | 824 | // Voterの設定 |
825 | - $this['authority_voter'] = function ($app) { |
|
825 | + $this['authority_voter'] = function($app) { |
|
826 | 826 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
827 | 827 | }; |
828 | 828 | |
829 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
829 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
830 | 830 | $voters[] = $app['authority_voter']; |
831 | 831 | |
832 | 832 | return $voters; |
833 | 833 | }); |
834 | 834 | |
835 | - $this['security.access_manager'] = function ($app) { |
|
835 | + $this['security.access_manager'] = function($app) { |
|
836 | 836 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
837 | 837 | }; |
838 | 838 | |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | { |
847 | 847 | $config = $this['config']; |
848 | 848 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
849 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
849 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
850 | 850 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
851 | 851 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
852 | 852 | }, self::EARLY_EVENT); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | $this->register(new ServiceProvider\EccubePluginServiceProvider()); |
864 | 864 | |
865 | 865 | // TODO Acme\ServiceProvider の初期化はここで OK? |
866 | - if (array_key_exists('service',$this['config'])) { |
|
866 | + if (array_key_exists('service', $this['config'])) { |
|
867 | 867 | foreach ($this['config']['service'] as $service) { |
868 | 868 | $this->register(new $service); |
869 | 869 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | $app = $this; |
1020 | 1020 | |
1021 | 1021 | // Response Event(http cache対応、event実行は一番遅く設定) |
1022 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1022 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1023 | 1023 | |
1024 | 1024 | if (!$event->isMasterRequest()) { |
1025 | 1025 | return; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | if (strtoupper($orderby) === "PATH") { |
95 | 95 | uasort( |
96 | 96 | $routes, |
97 | - function ($a, $b) { |
|
97 | + function($a, $b) { |
|
98 | 98 | return strcmp($a->getPath(), $b->getPath()); |
99 | 99 | } |
100 | 100 | ); |