@@ -959,7 +959,7 @@ |
||
959 | 959 | * 失敗 : \Doctrine\DBAL\DBALExceptionエラーが発生( 接続に失敗した場合 )、エラー画面を表示しdie() |
960 | 960 | * 備考 : app['debug']がtrueの際は処理を行わない |
961 | 961 | * |
962 | - * @return boolean true |
|
962 | + * @return null|boolean true |
|
963 | 963 | * |
964 | 964 | */ |
965 | 965 | protected function checkDatabaseConnection() |
@@ -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; |
@@ -52,11 +52,17 @@ |
||
52 | 52 | return $form; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param Application $app |
|
57 | + */ |
|
55 | 58 | protected function getSecurity($app) |
56 | 59 | { |
57 | 60 | return $app['security.token_storage']; |
58 | 61 | } |
59 | 62 | |
63 | + /** |
|
64 | + * @param Application $app |
|
65 | + */ |
|
60 | 66 | protected function isTokenValid($app) |
61 | 67 | { |
62 | 68 | $csrf = $app['form.csrf_provider']; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED); |
46 | 46 | |
47 | 47 | $form = $app['form.factory'] |
48 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
48 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
49 | 49 | ->getForm(); |
50 | 50 | $form->handleRequest($app['request']); |
51 | 51 |
@@ -230,6 +230,10 @@ discard block |
||
230 | 230 | return $str; |
231 | 231 | } |
232 | 232 | |
233 | + /** |
|
234 | + * @param string $topDir |
|
235 | + * @param Request $request |
|
236 | + */ |
|
233 | 237 | private function getTree($topDir, $request) |
234 | 238 | { |
235 | 239 | $finder = Finder::create()->in($topDir) |
@@ -267,6 +271,10 @@ discard block |
||
267 | 271 | return $tree; |
268 | 272 | } |
269 | 273 | |
274 | + /** |
|
275 | + * @param Application $app |
|
276 | + * @param string $nowDir |
|
277 | + */ |
|
270 | 278 | private function getFileList($app, $nowDir) |
271 | 279 | { |
272 | 280 | $topDir = $app['config']['user_data_realdir']; |
@@ -326,6 +334,9 @@ discard block |
||
326 | 334 | return (strpos($targetDir, $topDir) === 0); |
327 | 335 | } |
328 | 336 | |
337 | + /** |
|
338 | + * @return string |
|
339 | + */ |
|
329 | 340 | private function convertStrFromServer($target) |
330 | 341 | { |
331 | 342 | if ($this->encode == self::SJIS) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | private $error = null; |
40 | 40 | private $encode = ''; |
41 | 41 | |
42 | - public function __construct(){ |
|
42 | + public function __construct() { |
|
43 | 43 | $this->encode = self::UTF; |
44 | 44 | if ('\\' === DIRECTORY_SEPARATOR) { |
45 | 45 | $this->encode = self::SJIS; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $arrFileList = $this->getFileList($app, $nowDir); |
85 | 85 | |
86 | 86 | $javascript = $this->getJsArrayList($tree); |
87 | - $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');"; |
|
87 | + $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');"; |
|
88 | 88 | |
89 | 89 | return $app->render('Content/file.twig', array( |
90 | 90 | 'form' => $form->createView(), |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $nowDir = $this->checkDir($request->get('now_dir'), $topDir) |
142 | 142 | ? $this->normalizePath($request->get('now_dir')) |
143 | 143 | : $topDir; |
144 | - $fs->mkdir($nowDir . '/' . $filename); |
|
144 | + $fs->mkdir($nowDir.'/'.$filename); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $str = "arrTree = new Array();\n"; |
221 | 221 | foreach ($tree as $key => $val) { |
222 | - $str .= 'arrTree[' . $key . "] = new Array(" . $key . ", '" . $val['type'] . "', '" . $val['path'] . "', " . $val['rank'] . ','; |
|
222 | + $str .= 'arrTree['.$key."] = new Array(".$key.", '".$val['type']."', '".$val['path']."', ".$val['rank'].','; |
|
223 | 223 | if ($val['open']) { |
224 | 224 | $str .= "true);\n"; |
225 | 225 | } else { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | private function getFileList($app, $nowDir) |
271 | 271 | { |
272 | 272 | $topDir = $app['config']['user_data_realdir']; |
273 | - $filter = function (\SplFileInfo $file) use ($topDir) { |
|
273 | + $filter = function(\SplFileInfo $file) use ($topDir) { |
|
274 | 274 | $acceptPath = realpath($topDir); |
275 | 275 | $targetPath = $file->getRealPath(); |
276 | 276 | return (strpos($targetPath, $acceptPath) === 0); |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | /** |
524 | 524 | * フォームからの入直内容に基づいて、受注情報の再計算を行う |
525 | 525 | * |
526 | - * @param $app |
|
526 | + * @param Application $app |
|
527 | 527 | * @param $Order |
528 | 528 | */ |
529 | 529 | protected function calculate($app, \Eccube\Entity\Order $Order) |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | * - 受注ステータスが入金済に設定された場合に入金日を更新 |
614 | 614 | * |
615 | 615 | * |
616 | - * @param $app |
|
616 | + * @param Application $app |
|
617 | 617 | * @param $TargetOrder |
618 | 618 | * @param $OriginOrder |
619 | 619 | */ |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $session->set('eccube.admin.order.customer.search', $searchData); |
396 | 396 | $session->set('eccube.admin.order.customer.search.page_no', $page_no); |
397 | 397 | } else { |
398 | - $searchData = (array)$session->get('eccube.admin.order.customer.search'); |
|
398 | + $searchData = (array) $session->get('eccube.admin.order.customer.search'); |
|
399 | 399 | if (is_null($page_no)) { |
400 | 400 | $page_no = intval($session->get('eccube.admin.order.customer.search.page_no')); |
401 | 401 | } else { |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $session->set('eccube.admin.order.product.search', $searchData); |
551 | 551 | $session->set('eccube.admin.order.product.search.page_no', $page_no); |
552 | 552 | } else { |
553 | - $searchData = (array)$session->get('eccube.admin.order.product.search'); |
|
553 | + $searchData = (array) $session->get('eccube.admin.order.product.search'); |
|
554 | 554 | if (is_null($page_no)) { |
555 | 555 | $page_no = intval($session->get('eccube.admin.order.product.search.page_no')); |
556 | 556 | } else { |
@@ -354,6 +354,9 @@ |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | |
357 | + /** |
|
358 | + * @param Application $app |
|
359 | + */ |
|
357 | 360 | private function createBody($app, $header, $footer, $Order) |
358 | 361 | { |
359 | 362 | return $app->renderView('Mail/order.twig', array( |
@@ -336,10 +336,10 @@ |
||
336 | 336 | } |
337 | 337 | } |
338 | 338 | } else { |
339 | - $filter = function ($v) { |
|
339 | + $filter = function($v) { |
|
340 | 340 | return preg_match('/^ids\d+$/', $v); |
341 | 341 | }; |
342 | - $map = function ($v) { |
|
342 | + $map = function($v) { |
|
343 | 343 | return preg_replace('/[^\d+]/', '', $v); |
344 | 344 | }; |
345 | 345 | $keys = array_keys($request->query->all()); |
@@ -28,7 +28,6 @@ |
||
28 | 28 | use Eccube\Entity\Master\DeviceType; |
29 | 29 | use Eccube\Util\Str; |
30 | 30 | use Symfony\Component\Filesystem\Filesystem; |
31 | -use Symfony\Component\Finder\Finder; |
|
32 | 31 | use Symfony\Component\Form\FormError; |
33 | 32 | use Symfony\Component\HttpFoundation\Request; |
34 | 33 | use Symfony\Component\HttpFoundation\Response; |
@@ -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) { |
@@ -35,6 +35,9 @@ |
||
35 | 35 | { |
36 | 36 | private $app; |
37 | 37 | |
38 | + /** |
|
39 | + * @param \Silex\Application $app |
|
40 | + */ |
|
38 | 41 | public function __construct($app) |
39 | 42 | { |
40 | 43 | $this->app = $app; |
@@ -25,8 +25,6 @@ |
||
25 | 25 | |
26 | 26 | use Symfony\Component\Form\AbstractType; |
27 | 27 | use Symfony\Component\Form\FormBuilderInterface; |
28 | -use Symfony\Component\Form\FormError; |
|
29 | -use Symfony\Component\Form\FormEvents; |
|
30 | 28 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
31 | 29 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; |
32 | 30 | use Symfony\Component\Validator\Constraints as Assert; |
@@ -27,7 +27,6 @@ |
||
27 | 27 | use Symfony\Component\Form\AbstractType; |
28 | 28 | use Symfony\Component\Form\Extension\Core\Type; |
29 | 29 | use Symfony\Component\Form\FormBuilderInterface; |
30 | -use Symfony\Component\Validator\Constraints as Assert; |
|
31 | 30 | |
32 | 31 | class SearchProductType extends AbstractType |
33 | 32 | { |
@@ -131,7 +131,7 @@ |
||
131 | 131 | /** |
132 | 132 | * @param \Eccube\Entity\Member $Member |
133 | 133 | * |
134 | - * @return void |
|
134 | + * @return boolean |
|
135 | 135 | */ |
136 | 136 | public function up(\Eccube\Entity\Member $Member) |
137 | 137 | { |