@@ -112,7 +112,7 @@ |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($Product) { |
|
| 115 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($Product) { |
|
| 116 | 116 | $data = $event->getData(); |
| 117 | 117 | $form = $event->getForm(); |
| 118 | 118 | if (!is_null($Product->getClassName2())) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | )); |
| 62 | 62 | |
| 63 | 63 | $message = \Swift_Message::newInstance() |
| 64 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認') |
|
| 64 | + ->setSubject('['.$this->BaseInfo->getShopName().'] 会員登録のご確認') |
|
| 65 | 65 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 66 | 66 | ->setTo(array($Customer->getEmail())) |
| 67 | 67 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | )); |
| 103 | 103 | |
| 104 | 104 | $message = \Swift_Message::newInstance() |
| 105 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録が完了しました。') |
|
| 105 | + ->setSubject('['.$this->BaseInfo->getShopName().'] 会員登録が完了しました。') |
|
| 106 | 106 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 107 | 107 | ->setTo(array($Customer->getEmail())) |
| 108 | 108 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | )); |
| 145 | 145 | |
| 146 | 146 | $message = \Swift_Message::newInstance() |
| 147 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] 退会手続きのご完了') |
|
| 147 | + ->setSubject('['.$this->BaseInfo->getShopName().'] 退会手続きのご完了') |
|
| 148 | 148 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 149 | 149 | ->setTo(array($email)) |
| 150 | 150 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | // 問い合わせ者にメール送信 |
| 189 | 189 | $message = \Swift_Message::newInstance() |
| 190 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] お問い合わせを受け付けました。') |
|
| 190 | + ->setSubject('['.$this->BaseInfo->getShopName().'] お問い合わせを受け付けました。') |
|
| 191 | 191 | ->setFrom(array($this->BaseInfo->getEmail02() => $this->BaseInfo->getShopName())) |
| 192 | 192 | ->setTo(array($formData['email'])) |
| 193 | 193 | ->setBcc($this->BaseInfo->getEmail02()) |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | )); |
| 245 | 245 | |
| 246 | 246 | $message = \Swift_Message::newInstance() |
| 247 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] ' . $MailTemplate->getSubject()) |
|
| 247 | + ->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getSubject()) |
|
| 248 | 248 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 249 | 249 | ->setTo(array($Order->getEmail())) |
| 250 | 250 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | )); |
| 289 | 289 | |
| 290 | 290 | $message = \Swift_Message::newInstance() |
| 291 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認') |
|
| 291 | + ->setSubject('['.$this->BaseInfo->getShopName().'] 会員登録のご確認') |
|
| 292 | 292 | ->setFrom(array($this->BaseInfo->getEmail03() => $this->BaseInfo->getShopName())) |
| 293 | 293 | ->setTo(array($Customer->getEmail())) |
| 294 | 294 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | )); |
| 333 | 333 | |
| 334 | 334 | $message = \Swift_Message::newInstance() |
| 335 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] ' . $formData['subject']) |
|
| 335 | + ->setSubject('['.$this->BaseInfo->getShopName().'] '.$formData['subject']) |
|
| 336 | 336 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 337 | 337 | ->setTo(array($Order->getEmail())) |
| 338 | 338 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | )); |
| 374 | 374 | |
| 375 | 375 | $message = \Swift_Message::newInstance() |
| 376 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のご確認') |
|
| 376 | + ->setSubject('['.$this->BaseInfo->getShopName().'] パスワード変更のご確認') |
|
| 377 | 377 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 378 | 378 | ->setTo(array($Customer->getEmail())) |
| 379 | 379 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | )); |
| 415 | 415 | |
| 416 | 416 | $message = \Swift_Message::newInstance() |
| 417 | - ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ') |
|
| 417 | + ->setSubject('['.$this->BaseInfo->getShopName().'] パスワード変更のお知らせ') |
|
| 418 | 418 | ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName())) |
| 419 | 419 | ->setTo(array($Customer->getEmail())) |
| 420 | 420 | ->setBcc($this->BaseInfo->getEmail01()) |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | $this->app = $this->getSilexApplication(); |
| 54 | 54 | |
| 55 | - \Eccube\Util\Cache::clear($this->app,$input->getOption('all')); |
|
| 55 | + \Eccube\Util\Cache::clear($this->app, $input->getOption('all')); |
|
| 56 | 56 | $output->writeln(sprintf("%s <info>success</info>", 'cache:clear')); |
| 57 | 57 | |
| 58 | 58 | } |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $webProcessor = new WebProcessor(); |
| 112 | 112 | $uidProcessor = new UidProcessor(8); |
| 113 | 113 | |
| 114 | - $FingerCrossedHandler->pushProcessor(function ($record) use ($app, $uidProcessor, $webProcessor) { |
|
| 114 | + $FingerCrossedHandler->pushProcessor(function($record) use ($app, $uidProcessor, $webProcessor) { |
|
| 115 | 115 | // ログフォーマットに出力する値を独自に設定 |
| 116 | 116 | |
| 117 | 117 | $record['level_name'] = sprintf("%-5s", $record['level_name']); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $this->register(new MobileDetectServiceProvider()); |
| 147 | 147 | |
| 148 | 148 | $app = $this; |
| 149 | - $this->error(function (\Exception $e, $code) use ($app) { |
|
| 149 | + $this->error(function(\Exception $e, $code) use ($app) { |
|
| 150 | 150 | if ($app['debug']) { |
| 151 | 151 | return; |
| 152 | 152 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | 'locale' => $this['config']['locale'], |
| 215 | 215 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
| 216 | 216 | )); |
| 217 | - $this['translator'] = $this->share($this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 217 | + $this['translator'] = $this->share($this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 218 | 218 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 219 | 219 | |
| 220 | 220 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 262 | 262 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 263 | 263 | )); |
| 264 | - $this['twig'] = $this->share($this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 264 | + $this['twig'] = $this->share($this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 265 | 265 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 266 | 266 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 267 | 267 | |
| 268 | 268 | return $twig; |
| 269 | 269 | })); |
| 270 | 270 | |
| 271 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 271 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 272 | 272 | $app['admin'] = false; |
| 273 | 273 | $app['front'] = false; |
| 274 | 274 | $pathinfo = rawurldecode($request->getPathInfo()); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
| 282 | - $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 282 | + $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 283 | 283 | $paths = array(); |
| 284 | 284 | |
| 285 | 285 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | // twigのグローバル変数を定義. |
| 328 | 328 | $app = $this; |
| 329 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 329 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 330 | 330 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
| 331 | 331 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
| 332 | 332 | if (isset($app['twig_global_initialized']) && $app['twig_global_initialized'] === true) { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 393 | 393 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 394 | 394 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 395 | - \Swift::init(function () { |
|
| 395 | + \Swift::init(function() { |
|
| 396 | 396 | \Swift_DependencyContainer::getInstance() |
| 397 | 397 | ->register('mime.qpheaderencoder') |
| 398 | 398 | ->asAliasOf('mime.base64headerencoder'); |
@@ -572,19 +572,19 @@ discard block |
||
| 572 | 572 | array('^/mypage', 'ROLE_USER', $channel), |
| 573 | 573 | ); |
| 574 | 574 | |
| 575 | - $this['eccube.password_encoder'] = $this->share(function ($app) { |
|
| 575 | + $this['eccube.password_encoder'] = $this->share(function($app) { |
|
| 576 | 576 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
| 577 | 577 | }); |
| 578 | - $this['security.encoder_factory'] = $this->share(function ($app) { |
|
| 578 | + $this['security.encoder_factory'] = $this->share(function($app) { |
|
| 579 | 579 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
| 580 | 580 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
| 581 | 581 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
| 582 | 582 | )); |
| 583 | 583 | }); |
| 584 | - $this['eccube.event_listner.security'] = $this->share(function ($app) { |
|
| 584 | + $this['eccube.event_listner.security'] = $this->share(function($app) { |
|
| 585 | 585 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
| 586 | 586 | }); |
| 587 | - $this['user'] = function ($app) { |
|
| 587 | + $this['user'] = function($app) { |
|
| 588 | 588 | $token = $app['security']->getToken(); |
| 589 | 589 | |
| 590 | 590 | return ($token !== null) ? $token->getUser() : null; |
@@ -595,17 +595,17 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | // Voterの設定 |
| 597 | 597 | $app = $this; |
| 598 | - $this['authority_voter'] = $this->share(function ($app) { |
|
| 598 | + $this['authority_voter'] = $this->share(function($app) { |
|
| 599 | 599 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
| 600 | 600 | }); |
| 601 | 601 | |
| 602 | - $app['security.voters'] = $app->extend('security.voters', function ($voters) use ($app) { |
|
| 602 | + $app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) { |
|
| 603 | 603 | $voters[] = $app['authority_voter']; |
| 604 | 604 | |
| 605 | 605 | return $voters; |
| 606 | 606 | }); |
| 607 | 607 | |
| 608 | - $this['security.access_manager'] = $this->share(function ($app) { |
|
| 608 | + $this['security.access_manager'] = $this->share(function($app) { |
|
| 609 | 609 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
| 610 | 610 | }); |
| 611 | 611 | |
@@ -629,14 +629,14 @@ discard block |
||
| 629 | 629 | public function initPluginEventDispatcher() |
| 630 | 630 | { |
| 631 | 631 | // EventDispatcher |
| 632 | - $this['eccube.event.dispatcher'] = $this->share(function () { |
|
| 632 | + $this['eccube.event.dispatcher'] = $this->share(function() { |
|
| 633 | 633 | return new EventDispatcher(); |
| 634 | 634 | }); |
| 635 | 635 | |
| 636 | 636 | $app = $this; |
| 637 | 637 | |
| 638 | 638 | // hook point |
| 639 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 639 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 640 | 640 | if (!$event->isMasterRequest()) { |
| 641 | 641 | return; |
| 642 | 642 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 645 | 645 | }, self::EARLY_EVENT); |
| 646 | 646 | |
| 647 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 647 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 648 | 648 | if (!$event->isMasterRequest()) { |
| 649 | 649 | return; |
| 650 | 650 | } |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 654 | 654 | }); |
| 655 | 655 | |
| 656 | - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 656 | + $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 657 | 657 | if (!$event->isMasterRequest()) { |
| 658 | 658 | return; |
| 659 | 659 | } |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 663 | 663 | }); |
| 664 | 664 | |
| 665 | - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 665 | + $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 666 | 666 | if (!$event->isMasterRequest()) { |
| 667 | 667 | return; |
| 668 | 668 | } |
@@ -670,13 +670,13 @@ discard block |
||
| 670 | 670 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 671 | 671 | }, self::LATE_EVENT); |
| 672 | 672 | |
| 673 | - $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) { |
|
| 673 | + $this->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) { |
|
| 674 | 674 | $route = $event->getRequest()->attributes->get('_route'); |
| 675 | 675 | $hookpoint = "eccube.event.controller.$route.finish"; |
| 676 | 676 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 677 | 677 | }); |
| 678 | 678 | |
| 679 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 679 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 680 | 680 | if (!$event->isMasterRequest()) { |
| 681 | 681 | return; |
| 682 | 682 | } |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | }); |
| 686 | 686 | |
| 687 | 687 | // Request Event |
| 688 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 688 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 689 | 689 | |
| 690 | 690 | if (!$event->isMasterRequest()) { |
| 691 | 691 | return; |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | }, 30); // Routing(32)が解決しし, 認証判定(8)が実行される前のタイミング. |
| 717 | 717 | |
| 718 | 718 | // Controller Event |
| 719 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 719 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 720 | 720 | |
| 721 | 721 | if (!$event->isMasterRequest()) { |
| 722 | 722 | return; |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | }); |
| 747 | 747 | |
| 748 | 748 | // Response Event |
| 749 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 749 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 750 | 750 | if (!$event->isMasterRequest()) { |
| 751 | 751 | return; |
| 752 | 752 | } |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | }); |
| 776 | 776 | |
| 777 | 777 | // Exception Event |
| 778 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 778 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 779 | 779 | |
| 780 | 780 | if (!$event->isMasterRequest()) { |
| 781 | 781 | return; |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | }); |
| 806 | 806 | |
| 807 | 807 | // Terminate Event |
| 808 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 808 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 809 | 809 | |
| 810 | 810 | $route = $event->getRequest()->attributes->get('_route'); |
| 811 | 811 | |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | |
| 877 | 877 | // const |
| 878 | 878 | if (isset($config['const'])) { |
| 879 | - $this['config'] = $this->share($this->extend('config', function ($eccubeConfig) use ($config) { |
|
| 879 | + $this['config'] = $this->share($this->extend('config', function($eccubeConfig) use ($config) { |
|
| 880 | 880 | $eccubeConfig[$config['code']] = array( |
| 881 | 881 | 'const' => $config['const'], |
| 882 | 882 | ); |
@@ -1079,7 +1079,7 @@ discard block |
||
| 1079 | 1079 | $app = $this; |
| 1080 | 1080 | |
| 1081 | 1081 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 1082 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1082 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1083 | 1083 | |
| 1084 | 1084 | if (!$event->isMasterRequest()) { |
| 1085 | 1085 | return; |
@@ -41,28 +41,28 @@ discard block |
||
| 41 | 41 | public function register(BaseApplication $app) |
| 42 | 42 | { |
| 43 | 43 | // Service |
| 44 | - $app['eccube.service.system'] = $app->share(function () use ($app) { |
|
| 44 | + $app['eccube.service.system'] = $app->share(function() use ($app) { |
|
| 45 | 45 | return new \Eccube\Service\SystemService($app); |
| 46 | 46 | }); |
| 47 | - $app['view'] = $app->share(function () use ($app) { |
|
| 47 | + $app['view'] = $app->share(function() use ($app) { |
|
| 48 | 48 | return $app['twig']; |
| 49 | 49 | }); |
| 50 | - $app['eccube.service.cart'] = $app->share(function () use ($app) { |
|
| 50 | + $app['eccube.service.cart'] = $app->share(function() use ($app) { |
|
| 51 | 51 | return new \Eccube\Service\CartService($app); |
| 52 | 52 | }); |
| 53 | - $app['eccube.service.order'] = $app->share(function () use ($app) { |
|
| 53 | + $app['eccube.service.order'] = $app->share(function() use ($app) { |
|
| 54 | 54 | return new \Eccube\Service\OrderService($app); |
| 55 | 55 | }); |
| 56 | - $app['eccube.service.tax_rule'] = $app->share(function () use ($app) { |
|
| 56 | + $app['eccube.service.tax_rule'] = $app->share(function() use ($app) { |
|
| 57 | 57 | return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']); |
| 58 | 58 | }); |
| 59 | - $app['eccube.service.plugin'] = $app->share(function () use ($app) { |
|
| 59 | + $app['eccube.service.plugin'] = $app->share(function() use ($app) { |
|
| 60 | 60 | return new \Eccube\Service\PluginService($app); |
| 61 | 61 | }); |
| 62 | - $app['eccube.service.mail'] = $app->share(function () use ($app) { |
|
| 62 | + $app['eccube.service.mail'] = $app->share(function() use ($app) { |
|
| 63 | 63 | return new \Eccube\Service\MailService($app); |
| 64 | 64 | }); |
| 65 | - $app['eccube.service.csv.export'] = $app->share(function () use ($app) { |
|
| 65 | + $app['eccube.service.csv.export'] = $app->share(function() use ($app) { |
|
| 66 | 66 | $csvService = new \Eccube\Service\CsvExportService(); |
| 67 | 67 | $csvService->setEntityManager($app['orm.em']); |
| 68 | 68 | $csvService->setConfig($app['config']); |
@@ -74,184 +74,184 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | return $csvService; |
| 76 | 76 | }); |
| 77 | - $app['eccube.service.shopping'] = $app->share(function () use ($app) { |
|
| 77 | + $app['eccube.service.shopping'] = $app->share(function() use ($app) { |
|
| 78 | 78 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | 81 | // Repository |
| 82 | - $app['eccube.repository.master.authority'] = $app->share(function () use ($app) { |
|
| 82 | + $app['eccube.repository.master.authority'] = $app->share(function() use ($app) { |
|
| 83 | 83 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
| 84 | 84 | }); |
| 85 | - $app['eccube.repository.master.tag'] = $app->share(function () use ($app) { |
|
| 85 | + $app['eccube.repository.master.tag'] = $app->share(function() use ($app) { |
|
| 86 | 86 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
| 87 | 87 | }); |
| 88 | - $app['eccube.repository.master.pref'] = $app->share(function () use ($app) { |
|
| 88 | + $app['eccube.repository.master.pref'] = $app->share(function() use ($app) { |
|
| 89 | 89 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
| 90 | 90 | }); |
| 91 | - $app['eccube.repository.master.sex'] = $app->share(function () use ($app) { |
|
| 91 | + $app['eccube.repository.master.sex'] = $app->share(function() use ($app) { |
|
| 92 | 92 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
| 93 | 93 | }); |
| 94 | - $app['eccube.repository.master.disp'] = $app->share(function () use ($app) { |
|
| 94 | + $app['eccube.repository.master.disp'] = $app->share(function() use ($app) { |
|
| 95 | 95 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
| 96 | 96 | }); |
| 97 | - $app['eccube.repository.master.product_type'] = $app->share(function () use ($app) { |
|
| 97 | + $app['eccube.repository.master.product_type'] = $app->share(function() use ($app) { |
|
| 98 | 98 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
| 99 | 99 | }); |
| 100 | - $app['eccube.repository.master.page_max'] = $app->share(function () use ($app) { |
|
| 100 | + $app['eccube.repository.master.page_max'] = $app->share(function() use ($app) { |
|
| 101 | 101 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
| 102 | 102 | }); |
| 103 | - $app['eccube.repository.master.order_status'] = $app->share(function () use ($app) { |
|
| 103 | + $app['eccube.repository.master.order_status'] = $app->share(function() use ($app) { |
|
| 104 | 104 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 105 | 105 | }); |
| 106 | - $app['eccube.repository.master.device_type'] = $app->share(function () use ($app) { |
|
| 106 | + $app['eccube.repository.master.device_type'] = $app->share(function() use ($app) { |
|
| 107 | 107 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
| 108 | 108 | }); |
| 109 | - $app['eccube.repository.master.csv_type'] = $app->share(function () use ($app) { |
|
| 109 | + $app['eccube.repository.master.csv_type'] = $app->share(function() use ($app) { |
|
| 110 | 110 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - $app['eccube.repository.delivery'] = $app->share(function () use ($app) { |
|
| 113 | + $app['eccube.repository.delivery'] = $app->share(function() use ($app) { |
|
| 114 | 114 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
| 115 | 115 | }); |
| 116 | - $app['eccube.repository.delivery_date'] = $app->share(function () use ($app) { |
|
| 116 | + $app['eccube.repository.delivery_date'] = $app->share(function() use ($app) { |
|
| 117 | 117 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
| 118 | 118 | }); |
| 119 | - $app['eccube.repository.delivery_fee'] = $app->share(function () use ($app) { |
|
| 119 | + $app['eccube.repository.delivery_fee'] = $app->share(function() use ($app) { |
|
| 120 | 120 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
| 121 | 121 | }); |
| 122 | - $app['eccube.repository.delivery_time'] = $app->share(function () use ($app) { |
|
| 122 | + $app['eccube.repository.delivery_time'] = $app->share(function() use ($app) { |
|
| 123 | 123 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
| 124 | 124 | }); |
| 125 | - $app['eccube.repository.payment'] = $app->share(function () use ($app) { |
|
| 125 | + $app['eccube.repository.payment'] = $app->share(function() use ($app) { |
|
| 126 | 126 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
| 127 | 127 | }); |
| 128 | - $app['eccube.repository.payment_option'] = $app->share(function () use ($app) { |
|
| 128 | + $app['eccube.repository.payment_option'] = $app->share(function() use ($app) { |
|
| 129 | 129 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
| 130 | 130 | }); |
| 131 | - $app['eccube.repository.category'] = $app->share(function () use ($app) { |
|
| 131 | + $app['eccube.repository.category'] = $app->share(function() use ($app) { |
|
| 132 | 132 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
| 133 | 133 | $CategoryRepository->setApplication($app); |
| 134 | 134 | |
| 135 | 135 | return $CategoryRepository; |
| 136 | 136 | }); |
| 137 | - $app['eccube.repository.customer'] = $app->share(function () use ($app) { |
|
| 137 | + $app['eccube.repository.customer'] = $app->share(function() use ($app) { |
|
| 138 | 138 | return $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 139 | 139 | }); |
| 140 | - $app['eccube.repository.news'] = $app->share(function () use ($app) { |
|
| 140 | + $app['eccube.repository.news'] = $app->share(function() use ($app) { |
|
| 141 | 141 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 142 | 142 | }); |
| 143 | - $app['eccube.repository.mail_history'] = $app->share(function () use ($app) { |
|
| 143 | + $app['eccube.repository.mail_history'] = $app->share(function() use ($app) { |
|
| 144 | 144 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 145 | 145 | }); |
| 146 | - $app['eccube.repository.member'] = $app->share(function () use ($app) { |
|
| 146 | + $app['eccube.repository.member'] = $app->share(function() use ($app) { |
|
| 147 | 147 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 148 | 148 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 149 | 149 | return $memberRepository; |
| 150 | 150 | }); |
| 151 | - $app['eccube.repository.order'] = $app->share(function () use ($app) { |
|
| 151 | + $app['eccube.repository.order'] = $app->share(function() use ($app) { |
|
| 152 | 152 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 153 | 153 | }); |
| 154 | - $app['eccube.repository.product'] = $app->share(function () use ($app) { |
|
| 154 | + $app['eccube.repository.product'] = $app->share(function() use ($app) { |
|
| 155 | 155 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 156 | 156 | $productRepository->setApplication($app); |
| 157 | 157 | |
| 158 | 158 | return $productRepository; |
| 159 | 159 | }); |
| 160 | - $app['eccube.repository.product_image'] = $app->share(function () use ($app) { |
|
| 160 | + $app['eccube.repository.product_image'] = $app->share(function() use ($app) { |
|
| 161 | 161 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 162 | 162 | }); |
| 163 | - $app['eccube.repository.product_class'] = $app->share(function () use ($app) { |
|
| 163 | + $app['eccube.repository.product_class'] = $app->share(function() use ($app) { |
|
| 164 | 164 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 165 | 165 | }); |
| 166 | - $app['eccube.repository.product_stock'] = $app->share(function () use ($app) { |
|
| 166 | + $app['eccube.repository.product_stock'] = $app->share(function() use ($app) { |
|
| 167 | 167 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 168 | 168 | }); |
| 169 | - $app['eccube.repository.product_tag'] = $app->share(function () use ($app) { |
|
| 169 | + $app['eccube.repository.product_tag'] = $app->share(function() use ($app) { |
|
| 170 | 170 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 171 | 171 | }); |
| 172 | - $app['eccube.repository.class_name'] = $app->share(function () use ($app) { |
|
| 172 | + $app['eccube.repository.class_name'] = $app->share(function() use ($app) { |
|
| 173 | 173 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 174 | 174 | }); |
| 175 | - $app['eccube.repository.class_category'] = $app->share(function () use ($app) { |
|
| 175 | + $app['eccube.repository.class_category'] = $app->share(function() use ($app) { |
|
| 176 | 176 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 177 | 177 | }); |
| 178 | - $app['eccube.repository.customer_favorite_product'] = $app->share(function () use ($app) { |
|
| 178 | + $app['eccube.repository.customer_favorite_product'] = $app->share(function() use ($app) { |
|
| 179 | 179 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 180 | 180 | }); |
| 181 | - $app['eccube.repository.base_info'] = $app->share(function () use ($app) { |
|
| 181 | + $app['eccube.repository.base_info'] = $app->share(function() use ($app) { |
|
| 182 | 182 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 183 | 183 | $BaseInfoRepository->setApplication($app); |
| 184 | 184 | |
| 185 | 185 | return $BaseInfoRepository; |
| 186 | 186 | }); |
| 187 | - $app['eccube.repository.tax_rule'] = $app->share(function () use ($app) { |
|
| 187 | + $app['eccube.repository.tax_rule'] = $app->share(function() use ($app) { |
|
| 188 | 188 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 189 | 189 | $taxRuleRepository->setApplication($app); |
| 190 | 190 | |
| 191 | 191 | return $taxRuleRepository; |
| 192 | 192 | }); |
| 193 | - $app['eccube.repository.page_layout'] = $app->share(function () use ($app) { |
|
| 193 | + $app['eccube.repository.page_layout'] = $app->share(function() use ($app) { |
|
| 194 | 194 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 195 | 195 | $pageLayoutRepository->setApplication($app); |
| 196 | 196 | |
| 197 | 197 | return $pageLayoutRepository; |
| 198 | 198 | }); |
| 199 | - $app['eccube.repository.block'] = $app->share(function () use ($app) { |
|
| 199 | + $app['eccube.repository.block'] = $app->share(function() use ($app) { |
|
| 200 | 200 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 201 | 201 | $blockRepository->setApplication($app); |
| 202 | 202 | |
| 203 | 203 | return $blockRepository; |
| 204 | 204 | }); |
| 205 | - $app['eccube.repository.order'] = $app->share(function () use ($app) { |
|
| 205 | + $app['eccube.repository.order'] = $app->share(function() use ($app) { |
|
| 206 | 206 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 207 | 207 | $orderRepository->setApplication($app); |
| 208 | 208 | |
| 209 | 209 | return $orderRepository; |
| 210 | 210 | }); |
| 211 | - $app['eccube.repository.customer_address'] = $app->share(function () use ($app) { |
|
| 211 | + $app['eccube.repository.customer_address'] = $app->share(function() use ($app) { |
|
| 212 | 212 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 213 | 213 | }); |
| 214 | - $app['eccube.repository.shipping'] = $app->share(function () use ($app) { |
|
| 214 | + $app['eccube.repository.shipping'] = $app->share(function() use ($app) { |
|
| 215 | 215 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 216 | 216 | }); |
| 217 | - $app['eccube.repository.customer_status'] = $app->share(function () use ($app) { |
|
| 217 | + $app['eccube.repository.customer_status'] = $app->share(function() use ($app) { |
|
| 218 | 218 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 219 | 219 | }); |
| 220 | - $app['eccube.repository.order_status'] = $app->share(function () use ($app) { |
|
| 220 | + $app['eccube.repository.order_status'] = $app->share(function() use ($app) { |
|
| 221 | 221 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 222 | 222 | }); |
| 223 | - $app['eccube.repository.mail_template'] = $app->share(function () use ($app) { |
|
| 223 | + $app['eccube.repository.mail_template'] = $app->share(function() use ($app) { |
|
| 224 | 224 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 225 | 225 | }); |
| 226 | - $app['eccube.repository.csv'] = $app->share(function () use ($app) { |
|
| 226 | + $app['eccube.repository.csv'] = $app->share(function() use ($app) { |
|
| 227 | 227 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 228 | 228 | }); |
| 229 | - $app['eccube.repository.template'] = $app->share(function () use ($app) { |
|
| 229 | + $app['eccube.repository.template'] = $app->share(function() use ($app) { |
|
| 230 | 230 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 231 | 231 | }); |
| 232 | - $app['eccube.repository.authority_role'] = $app->share(function () use ($app) { |
|
| 232 | + $app['eccube.repository.authority_role'] = $app->share(function() use ($app) { |
|
| 233 | 233 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 234 | 234 | }); |
| 235 | 235 | |
| 236 | - $app['paginator'] = $app->protect(function () { |
|
| 236 | + $app['paginator'] = $app->protect(function() { |
|
| 237 | 237 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 238 | 238 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 239 | 239 | |
| 240 | 240 | return $paginator; |
| 241 | 241 | }); |
| 242 | 242 | |
| 243 | - $app['eccube.repository.help'] = $app->share(function () use ($app) { |
|
| 243 | + $app['eccube.repository.help'] = $app->share(function() use ($app) { |
|
| 244 | 244 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 245 | 245 | }); |
| 246 | - $app['eccube.repository.plugin'] = $app->share(function () use ($app) { |
|
| 246 | + $app['eccube.repository.plugin'] = $app->share(function() use ($app) { |
|
| 247 | 247 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 248 | 248 | }); |
| 249 | - $app['eccube.repository.plugin_event_handler'] = $app->share(function () use ($app) { |
|
| 249 | + $app['eccube.repository.plugin_event_handler'] = $app->share(function() use ($app) { |
|
| 250 | 250 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 251 | 251 | }); |
| 252 | 252 | // em |
| 253 | 253 | if (isset($app['orm.em'])) { |
| 254 | - $app['orm.em'] = $app->share($app->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 254 | + $app['orm.em'] = $app->share($app->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 255 | 255 | // tax_rule |
| 256 | 256 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
| 257 | 257 | $taxRuleRepository->setApplication($app); |
@@ -278,13 +278,13 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | // Form\Type |
| 281 | - $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 281 | + $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 282 | 282 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 283 | 283 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 284 | 284 | |
| 285 | 285 | return $extensions; |
| 286 | 286 | })); |
| 287 | - $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
|
| 287 | + $app['form.types'] = $app->share($app->extend('form.types', function($types) use ($app) { |
|
| 288 | 288 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 289 | 289 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 290 | 290 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | return $log; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - foreach (array_reverse(file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) as $line) { |
|
| 86 | + foreach (array_reverse(file($logFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)) as $line) { |
|
| 87 | 87 | // 上限に達した場合、処理を抜ける |
| 88 | 88 | if (count($log) >= $formData['line_max']) { |
| 89 | 89 | break; |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | // ファイルアップロード |
| 94 | 94 | $file = $form['payment_image']->getData(); |
| 95 | 95 | $fs = new Filesystem(); |
| 96 | - if ($file && $fs->exists($app['config']['image_temp_realdir'] . '/' . $file)) { |
|
| 96 | + if ($file && $fs->exists($app['config']['image_temp_realdir'].'/'.$file)) { |
|
| 97 | 97 | $fs->rename( |
| 98 | - $app['config']['image_temp_realdir'] . '/' . $file, |
|
| 99 | - $app['config']['image_save_realdir'] . '/' . $file |
|
| 98 | + $app['config']['image_temp_realdir'].'/'.$file, |
|
| 99 | + $app['config']['image_save_realdir'].'/'.$file |
|
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $extension = $image->guessExtension(); |
| 147 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
| 147 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
| 148 | 148 | $image->move($app['config']['image_temp_realdir'], $filename); |
| 149 | 149 | } |
| 150 | 150 | $event = new EventArgs( |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | foreach ($Payments as $Payment) { |
| 181 | 181 | if ($Payment->getId() != $id) { |
| 182 | 182 | $Payment->setRank($rank); |
| 183 | - $rank ++; |
|
| 183 | + $rank++; |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | ); |
| 195 | 195 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_PAYMENT_DELETE_COMPLETE, $event); |
| 196 | 196 | |
| 197 | - $app->addSuccess('admin.delete.complete', 'admin') ; |
|
| 197 | + $app->addSuccess('admin.delete.complete', 'admin'); |
|
| 198 | 198 | |
| 199 | 199 | return $app->redirect($app->url('admin_setting_shop_payment')); |
| 200 | 200 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode; |
| 78 | 78 | $config['template_html_realdir'] = $config['public_path_realdir'].'/template/'.$templateCode; |
| 79 | 79 | $config['front_urlpath'] = $config['root_urlpath'].RELATIVE_PUBLIC_DIR_PATH.'/template/'.$templateCode; |
| 80 | - $config['block_realdir'] =$config['template_realdir'].'/Block'; |
|
| 80 | + $config['block_realdir'] = $config['template_realdir'].'/Block'; |
|
| 81 | 81 | |
| 82 | 82 | if (file_exists($file.'.php')) { |
| 83 | 83 | file_put_contents($file.'.php', sprintf('<?php return %s', var_export($config, true)).';'); |
@@ -117,19 +117,19 @@ discard block |
||
| 117 | 117 | // 該当テンプレートのディレクトリ |
| 118 | 118 | $config = $app['config']; |
| 119 | 119 | $templateCode = $Template->getCode(); |
| 120 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
| 121 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
| 120 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
| 121 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
| 122 | 122 | |
| 123 | 123 | // 一時ディレクトリ |
| 124 | 124 | $uniqId = sha1(Str::random(32)); |
| 125 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; |
|
| 126 | - $appDir = $tmpDir . '/app'; |
|
| 127 | - $htmlDir = $tmpDir . '/html'; |
|
| 125 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; |
|
| 126 | + $appDir = $tmpDir.'/app'; |
|
| 127 | + $htmlDir = $tmpDir.'/html'; |
|
| 128 | 128 | |
| 129 | 129 | // ファイル名 |
| 130 | - $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar'; |
|
| 131 | - $tarGzFile = $tarFile . '.gz'; |
|
| 132 | - $downloadFileName = $Template->getCode() . '.tar.gz'; |
|
| 130 | + $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar'; |
|
| 131 | + $tarGzFile = $tarFile.'.gz'; |
|
| 132 | + $downloadFileName = $Template->getCode().'.tar.gz'; |
|
| 133 | 133 | |
| 134 | 134 | // 該当テンプレートを一時ディレクトリへコピーする. |
| 135 | 135 | $fs = new Filesystem(); |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | // ダウンロード完了後にファイルを削除する. |
| 151 | 151 | // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony |
| 152 | - $app->finish(function (Request $request, Response $response, \Silex\Application $app) use ( |
|
| 152 | + $app->finish(function(Request $request, Response $response, \Silex\Application $app) use ( |
|
| 153 | 153 | $tmpDir, |
| 154 | 154 | $tarFile, |
| 155 | 155 | $tarGzFile |
| 156 | 156 | ) { |
| 157 | - $app['monolog']->addDebug('remove temp file: ' . $tmpDir); |
|
| 158 | - $app['monolog']->addDebug('remove temp file: ' . $tarFile); |
|
| 159 | - $app['monolog']->addDebug('remove temp file: ' . $tarGzFile); |
|
| 157 | + $app['monolog']->addDebug('remove temp file: '.$tmpDir); |
|
| 158 | + $app['monolog']->addDebug('remove temp file: '.$tarFile); |
|
| 159 | + $app['monolog']->addDebug('remove temp file: '.$tarGzFile); |
|
| 160 | 160 | $fs = new Filesystem(); |
| 161 | 161 | $fs->remove($tmpDir); |
| 162 | 162 | $fs->remove($tarFile); |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | // テンプレートディレクトリの削除 |
| 198 | 198 | $config = $app['config']; |
| 199 | 199 | $templateCode = $Template->getCode(); |
| 200 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
| 201 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
| 200 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
| 201 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
| 202 | 202 | |
| 203 | 203 | $fs = new Filesystem(); |
| 204 | 204 | $fs->remove($targetRealDir); |
@@ -241,18 +241,18 @@ discard block |
||
| 241 | 241 | // 該当テンプレートのディレクトリ |
| 242 | 242 | $config = $app['config']; |
| 243 | 243 | $templateCode = $Template->getCode(); |
| 244 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
| 245 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
| 244 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
| 245 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
| 246 | 246 | |
| 247 | 247 | // 一時ディレクトリ |
| 248 | 248 | $uniqId = sha1(Str::random(32)); |
| 249 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; |
|
| 250 | - $appDir = $tmpDir . '/app'; |
|
| 251 | - $htmlDir = $tmpDir . '/html'; |
|
| 249 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; |
|
| 250 | + $appDir = $tmpDir.'/app'; |
|
| 251 | + $htmlDir = $tmpDir.'/html'; |
|
| 252 | 252 | |
| 253 | 253 | $formFile = $form['file']->getData(); |
| 254 | 254 | // ファイル名 |
| 255 | - $archive = $templateCode . '.' . $formFile->getClientOriginalExtension(); |
|
| 255 | + $archive = $templateCode.'.'.$formFile->getClientOriginalExtension(); |
|
| 256 | 256 | |
| 257 | 257 | // ファイルを一時ディレクトリへ移動. |
| 258 | 258 | $formFile->move($tmpDir, $archive); |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | try { |
| 262 | 262 | if ($formFile->getClientOriginalExtension() == 'zip') { |
| 263 | 263 | $zip = new \ZipArchive(); |
| 264 | - $zip->open($tmpDir . '/' . $archive); |
|
| 264 | + $zip->open($tmpDir.'/'.$archive); |
|
| 265 | 265 | $zip->extractTo($tmpDir); |
| 266 | 266 | $zip->close(); |
| 267 | 267 | } else { |
| 268 | - $phar = new \PharData($tmpDir . '/' . $archive); |
|
| 268 | + $phar = new \PharData($tmpDir.'/'.$archive); |
|
| 269 | 269 | $phar->extractTo($tmpDir, null, true); |
| 270 | 270 | } |
| 271 | 271 | } catch (\Exception $e) { |