@@ -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() |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $this->register(new \Eccube\ServiceProvider\ValidatorServiceProvider()); |
| 137 | 137 | |
| 138 | 138 | $app = $this; |
| 139 | - $this->error(function (\Exception $e, $code) use ($app) { |
|
| 139 | + $this->error(function(\Exception $e, $code) use ($app) { |
|
| 140 | 140 | if ($app['debug']) { |
| 141 | 141 | return; |
| 142 | 142 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $this->register(new \Silex\Provider\TranslationServiceProvider(), array( |
| 204 | 204 | 'locale' => $this['config']['locale'], |
| 205 | 205 | )); |
| 206 | - $this['translator'] = $this->share($this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 206 | + $this['translator'] = $this->share($this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 207 | 207 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 208 | 208 | |
| 209 | 209 | $r = new \ReflectionClass('Symfony\Component\Validator\Validator'); |
@@ -256,16 +256,16 @@ discard block |
||
| 256 | 256 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 257 | 257 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 258 | 258 | )); |
| 259 | - $this['twig'] = $this->share($this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 259 | + $this['twig'] = $this->share($this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 260 | 260 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 261 | 261 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 262 | 262 | |
| 263 | 263 | return $twig; |
| 264 | 264 | })); |
| 265 | 265 | |
| 266 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 266 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 267 | 267 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
| 268 | - $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 268 | + $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 269 | 269 | $paths = array(); |
| 270 | 270 | |
| 271 | 271 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | // twigのグローバル変数を定義. |
| 319 | 319 | $app = $this; |
| 320 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 320 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 321 | 321 | // ショップ基本情報 |
| 322 | 322 | $BaseInfo = $app['eccube.repository.base_info']->get(); |
| 323 | 323 | $app['twig']->addGlobal('BaseInfo', $BaseInfo); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 378 | 378 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 379 | 379 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 380 | - \Swift::init(function () { |
|
| 380 | + \Swift::init(function() { |
|
| 381 | 381 | \Swift_DependencyContainer::getInstance() |
| 382 | 382 | ->register('mime.qpheaderencoder') |
| 383 | 383 | ->asAliasOf('mime.base64headerencoder'); |
@@ -563,19 +563,19 @@ discard block |
||
| 563 | 563 | array('^/mypage', 'ROLE_USER'), |
| 564 | 564 | ); |
| 565 | 565 | |
| 566 | - $this['eccube.password_encoder'] = $this->share(function ($app) { |
|
| 566 | + $this['eccube.password_encoder'] = $this->share(function($app) { |
|
| 567 | 567 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
| 568 | 568 | }); |
| 569 | - $this['security.encoder_factory'] = $this->share(function ($app) { |
|
| 569 | + $this['security.encoder_factory'] = $this->share(function($app) { |
|
| 570 | 570 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
| 571 | 571 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
| 572 | 572 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
| 573 | 573 | )); |
| 574 | 574 | }); |
| 575 | - $this['eccube.event_listner.security'] = $this->share(function ($app) { |
|
| 575 | + $this['eccube.event_listner.security'] = $this->share(function($app) { |
|
| 576 | 576 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
| 577 | 577 | }); |
| 578 | - $this['user'] = function ($app) { |
|
| 578 | + $this['user'] = function($app) { |
|
| 579 | 579 | $token = $app['security']->getToken(); |
| 580 | 580 | |
| 581 | 581 | return ($token !== null) ? $token->getUser() : null; |
@@ -586,17 +586,17 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | // Voterの設定 |
| 588 | 588 | $app = $this; |
| 589 | - $this['authority_voter'] = $this->share(function ($app) { |
|
| 589 | + $this['authority_voter'] = $this->share(function($app) { |
|
| 590 | 590 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
| 591 | 591 | }); |
| 592 | 592 | |
| 593 | - $app['security.voters'] = $app->extend('security.voters', function ($voters) use ($app) { |
|
| 593 | + $app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) { |
|
| 594 | 594 | $voters[] = $app['authority_voter']; |
| 595 | 595 | |
| 596 | 596 | return $voters; |
| 597 | 597 | }); |
| 598 | 598 | |
| 599 | - $this['security.access_manager'] = $this->share(function ($app) { |
|
| 599 | + $this['security.access_manager'] = $this->share(function($app) { |
|
| 600 | 600 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
| 601 | 601 | }); |
| 602 | 602 | |
@@ -620,14 +620,14 @@ discard block |
||
| 620 | 620 | public function initPluginEventDispatcher() |
| 621 | 621 | { |
| 622 | 622 | // EventDispatcher |
| 623 | - $this['eccube.event.dispatcher'] = $this->share(function () { |
|
| 623 | + $this['eccube.event.dispatcher'] = $this->share(function() { |
|
| 624 | 624 | return new EventDispatcher(); |
| 625 | 625 | }); |
| 626 | 626 | |
| 627 | 627 | $app = $this; |
| 628 | 628 | |
| 629 | 629 | // hook point |
| 630 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 630 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 631 | 631 | if (!$event->isMasterRequest()) { |
| 632 | 632 | return; |
| 633 | 633 | } |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 636 | 636 | }, self::EARLY_EVENT); |
| 637 | 637 | |
| 638 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 638 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 639 | 639 | if (!$event->isMasterRequest()) { |
| 640 | 640 | return; |
| 641 | 641 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 645 | 645 | }); |
| 646 | 646 | |
| 647 | - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 647 | + $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $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 | } |
@@ -661,19 +661,19 @@ discard block |
||
| 661 | 661 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 662 | 662 | }, self::LATE_EVENT); |
| 663 | 663 | |
| 664 | - $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) { |
|
| 664 | + $this->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) { |
|
| 665 | 665 | $route = $event->getRequest()->attributes->get('_route'); |
| 666 | 666 | $hookpoint = "eccube.event.controller.$route.finish"; |
| 667 | 667 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 668 | 668 | }); |
| 669 | 669 | |
| 670 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 670 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 671 | 671 | $route = $event->getRequest()->attributes->get('_route'); |
| 672 | 672 | $app['eccube.event.dispatcher']->dispatch('eccube.event.render.'.$route.'.before', $event); |
| 673 | 673 | }); |
| 674 | 674 | |
| 675 | 675 | // Request Event |
| 676 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 676 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 677 | 677 | |
| 678 | 678 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
| 679 | 679 | return; |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | }, 30); // Routing(32)が解決しし, 認証判定(8)が実行される前のタイミング. |
| 705 | 705 | |
| 706 | 706 | // Controller Event |
| 707 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 707 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 708 | 708 | |
| 709 | 709 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
| 710 | 710 | return; |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | }); |
| 736 | 736 | |
| 737 | 737 | // Response Event |
| 738 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 738 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 739 | 739 | |
| 740 | 740 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
| 741 | 741 | return; |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | }); |
| 766 | 766 | |
| 767 | 767 | // Exception Event |
| 768 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 768 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 769 | 769 | |
| 770 | 770 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
| 771 | 771 | return; |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | }); |
| 796 | 796 | |
| 797 | 797 | // Terminate Event |
| 798 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 798 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 799 | 799 | |
| 800 | 800 | $route = $event->getRequest()->attributes->get('_route'); |
| 801 | 801 | |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | |
| 872 | 872 | // const |
| 873 | 873 | if (isset($config['const'])) { |
| 874 | - $this['config'] = $this->share($this->extend('config', function ($eccubeConfig) use ($config) { |
|
| 874 | + $this['config'] = $this->share($this->extend('config', function($eccubeConfig) use ($config) { |
|
| 875 | 875 | $eccubeConfig[$config['code']] = array( |
| 876 | 876 | 'const' => $config['const'], |
| 877 | 877 | ); |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | $app = $this; |
| 1075 | 1075 | |
| 1076 | 1076 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 1077 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1077 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1078 | 1078 | |
| 1079 | 1079 | $request = $event->getRequest(); |
| 1080 | 1080 | $response = $event->getResponse(); |
@@ -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; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $arrFileList = $this->getFileList($app, $nowDir); |
| 83 | 83 | |
| 84 | 84 | $javascript = $this->getJsArrayList($tree); |
| 85 | - $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');"; |
|
| 85 | + $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');"; |
|
| 86 | 86 | |
| 87 | 87 | return $app->render('Content/file.twig', array( |
| 88 | 88 | 'form' => $form->createView(), |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $nowDir = $this->checkDir($request->get('now_dir'), $topDir) |
| 140 | 140 | ? $this->normalizePath($request->get('now_dir')) |
| 141 | 141 | : $topDir; |
| 142 | - $fs->mkdir($nowDir . '/' . $filename); |
|
| 142 | + $fs->mkdir($nowDir.'/'.$filename); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
@@ -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) { |
@@ -336,6 +336,9 @@ |
||
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | |
| 339 | + /** |
|
| 340 | + * @param InstallApplication $app |
|
| 341 | + */ |
|
| 339 | 342 | private function checkModules($app) |
| 340 | 343 | { |
| 341 | 344 | foreach ($this->required_modules as $module) { |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function __construct() |
| 58 | 58 | { |
| 59 | - $this->config_path = __DIR__ . '/../../../../app/config/eccube'; |
|
| 60 | - $this->dist_path = __DIR__ . '/../../Resource/config'; |
|
| 61 | - $this->cache_path = __DIR__ . '/../../../../app/cache'; |
|
| 59 | + $this->config_path = __DIR__.'/../../../../app/config/eccube'; |
|
| 60 | + $this->dist_path = __DIR__.'/../../Resource/config'; |
|
| 61 | + $this->cache_path = __DIR__.'/../../../../app/cache'; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | private function isValid(Request $request, Form $form) |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | return $app['twig']->render('step1.twig', array( |
| 110 | 110 | 'form' => $form->createView(), |
| 111 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 111 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 112 | 112 | )); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | return $app['twig']->render('step2.twig', array( |
| 133 | 133 | 'protectedDirs' => $protectedDirs, |
| 134 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 134 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 135 | 135 | )); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | if (empty($sessionData['shop_name'])) { |
| 147 | 147 | |
| 148 | - $config_file = $this->config_path . '/config.yml'; |
|
| 148 | + $config_file = $this->config_path.'/config.yml'; |
|
| 149 | 149 | $fs = new Filesystem(); |
| 150 | 150 | |
| 151 | 151 | if ($fs->exists($config_file)) { |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // セキュリティの設定 |
| 162 | - $config_file = $this->config_path . '/path.yml'; |
|
| 162 | + $config_file = $this->config_path.'/path.yml'; |
|
| 163 | 163 | $config = Yaml::parse(file_get_contents($config_file)); |
| 164 | 164 | $sessionData['admin_dir'] = $config['admin_route']; |
| 165 | 165 | |
| 166 | - $config_file = $this->config_path . '/config.yml'; |
|
| 166 | + $config_file = $this->config_path.'/config.yml'; |
|
| 167 | 167 | $config = Yaml::parse(file_get_contents($config_file)); |
| 168 | 168 | |
| 169 | 169 | $allowHost = $config['admin_allow_host']; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $sessionData['admin_force_ssl'] = (bool) $config['force_ssl']; |
| 174 | 174 | |
| 175 | 175 | // メール設定 |
| 176 | - $config_file = $this->config_path . '/mail.yml'; |
|
| 176 | + $config_file = $this->config_path.'/mail.yml'; |
|
| 177 | 177 | $config = Yaml::parse(file_get_contents($config_file)); |
| 178 | 178 | $mail = $config['mail']; |
| 179 | 179 | $sessionData['mail_backend'] = $mail['transport']; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | return $app['twig']->render('step3.twig', array( |
| 198 | 198 | 'form' => $form->createView(), |
| 199 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 199 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 200 | 200 | )); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | if (empty($sessionData['database'])) { |
| 213 | 213 | |
| 214 | - $config_file = $this->config_path . '/database.yml'; |
|
| 214 | + $config_file = $this->config_path.'/database.yml'; |
|
| 215 | 215 | $fs = new Filesystem(); |
| 216 | 216 | |
| 217 | 217 | if ($fs->exists($config_file)) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | return $app['twig']->render('step4.twig', array( |
| 241 | 241 | 'form' => $form->createView(), |
| 242 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 242 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 243 | 243 | )); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $host = $request->getSchemeAndHttpHost(); |
| 286 | 286 | $basePath = $request->getBasePath(); |
| 287 | 287 | $params = array( |
| 288 | - 'http_url' => $host . $basePath, |
|
| 288 | + 'http_url' => $host.$basePath, |
|
| 289 | 289 | 'shop_name' => $sessionData['shop_name'], |
| 290 | 290 | ); |
| 291 | 291 | |
@@ -300,24 +300,24 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | return $app['twig']->render('step5.twig', array( |
| 302 | 302 | 'form' => $form->createView(), |
| 303 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 303 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 304 | 304 | )); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | // インストール完了 |
| 308 | 308 | public function complete(InstallApplication $app, Request $request) |
| 309 | 309 | { |
| 310 | - $config_file = $this->config_path . '/path.yml'; |
|
| 310 | + $config_file = $this->config_path.'/path.yml'; |
|
| 311 | 311 | $config = Yaml::parse(file_get_contents($config_file)); |
| 312 | 312 | |
| 313 | 313 | $host = $request->getSchemeAndHttpHost(); |
| 314 | 314 | $basePath = $request->getBasePath(); |
| 315 | 315 | |
| 316 | - $adminUrl = $host . $basePath . '/' . $config['admin_dir']; |
|
| 316 | + $adminUrl = $host.$basePath.'/'.$config['admin_dir']; |
|
| 317 | 317 | |
| 318 | 318 | return $app['twig']->render('complete.twig', array( |
| 319 | 319 | 'admin_url' => $adminUrl, |
| 320 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 320 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 321 | 321 | )); |
| 322 | 322 | } |
| 323 | 323 | |
@@ -333,12 +333,12 @@ discard block |
||
| 333 | 333 | { |
| 334 | 334 | foreach ($this->required_modules as $module) { |
| 335 | 335 | if (!extension_loaded($module)) { |
| 336 | - $app->addDanger('[必須] ' . $module . ' 拡張モジュールが有効になっていません。', 'install'); |
|
| 336 | + $app->addDanger('[必須] '.$module.' 拡張モジュールが有効になっていません。', 'install'); |
|
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if (!extension_loaded('pdo_mysql') && !extension_loaded('pdo_pgsql')) { |
| 341 | - $app->addDanger('[必須] ' . 'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
| 341 | + $app->addDanger('[必須] '.'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | foreach ($this->recommended_module as $module) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | //http://php.net/manual/en/migration71.deprecated.php |
| 349 | 349 | continue; |
| 350 | 350 | } |
| 351 | - $app->addWarning('[推奨] ' . $module . ' 拡張モジュールが有効になっていません。', 'install'); |
|
| 351 | + $app->addWarning('[推奨] '.$module.' 拡張モジュールが有効になっていません。', 'install'); |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | if (!function_exists('apache_get_modules')) { |
| 367 | 367 | $app->addWarning('mod_rewrite が有効になっているか不明です。', 'install'); |
| 368 | 368 | } elseif (!in_array('mod_rewrite', apache_get_modules())) { |
| 369 | - $app->addDanger('[必須] ' . 'mod_rewriteを有効にしてください。', 'install'); |
|
| 369 | + $app->addDanger('[必須] '.'mod_rewriteを有効にしてください。', 'install'); |
|
| 370 | 370 | } |
| 371 | 371 | } elseif (isset($_SERVER['SERVER_SOFTWARE']) && strpos('Microsoft-IIS', $_SERVER['SERVER_SOFTWARE']) !== false) { |
| 372 | 372 | // iis |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | |
| 378 | 378 | private function setPDO() |
| 379 | 379 | { |
| 380 | - $config_file = $this->config_path . '/database.yml'; |
|
| 380 | + $config_file = $this->config_path.'/database.yml'; |
|
| 381 | 381 | $config = Yaml::parse(file_get_contents($config_file)); |
| 382 | 382 | |
| 383 | 383 | try { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | */ |
| 412 | 412 | private function getEntityManager() |
| 413 | 413 | { |
| 414 | - $config_file = $this->config_path . '/database.yml'; |
|
| 414 | + $config_file = $this->config_path.'/database.yml'; |
|
| 415 | 415 | $database = Yaml::parse(file_get_contents($config_file)); |
| 416 | 416 | |
| 417 | 417 | $this->app->register(new \Silex\Provider\DoctrineServiceProvider(), array( |
@@ -419,15 +419,15 @@ discard block |
||
| 419 | 419 | )); |
| 420 | 420 | |
| 421 | 421 | $this->app->register(new \Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), array( |
| 422 | - 'orm.proxies_dir' => __DIR__ . '/../../app/cache/doctrine', |
|
| 422 | + 'orm.proxies_dir' => __DIR__.'/../../app/cache/doctrine', |
|
| 423 | 423 | 'orm.em.options' => array( |
| 424 | 424 | 'mappings' => array( |
| 425 | 425 | array( |
| 426 | 426 | 'type' => 'yml', |
| 427 | 427 | 'namespace' => 'Eccube\Entity', |
| 428 | 428 | 'path' => array( |
| 429 | - __DIR__ . '/../../Resource/doctrine', |
|
| 430 | - __DIR__ . '/../../Resource/doctrine/master', |
|
| 429 | + __DIR__.'/../../Resource/doctrine', |
|
| 430 | + __DIR__.'/../../Resource/doctrine/master', |
|
| 431 | 431 | ), |
| 432 | 432 | ), |
| 433 | 433 | ), |
@@ -454,11 +454,11 @@ discard block |
||
| 454 | 454 | { |
| 455 | 455 | $this->resetNatTimer(); |
| 456 | 456 | |
| 457 | - $config_file = $this->config_path . '/database.yml'; |
|
| 457 | + $config_file = $this->config_path.'/database.yml'; |
|
| 458 | 458 | $database = Yaml::parse(file_get_contents($config_file)); |
| 459 | 459 | $config['database'] = $database['database']; |
| 460 | 460 | |
| 461 | - $config_file = $this->config_path . '/config.yml'; |
|
| 461 | + $config_file = $this->config_path.'/config.yml'; |
|
| 462 | 462 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
| 463 | 463 | $config['config'] = $baseConfig; |
| 464 | 464 | |
@@ -514,11 +514,11 @@ discard block |
||
| 514 | 514 | { |
| 515 | 515 | $this->resetNatTimer(); |
| 516 | 516 | |
| 517 | - $config_file = $this->config_path . '/database.yml'; |
|
| 517 | + $config_file = $this->config_path.'/database.yml'; |
|
| 518 | 518 | $database = Yaml::parse(file_get_contents($config_file)); |
| 519 | 519 | $config['database'] = $database['database']; |
| 520 | 520 | |
| 521 | - $config_file = $this->config_path . '/config.yml'; |
|
| 521 | + $config_file = $this->config_path.'/config.yml'; |
|
| 522 | 522 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
| 523 | 523 | $config['config'] = $baseConfig; |
| 524 | 524 | |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $config = new Configuration($app['db']); |
| 582 | 582 | $config->setMigrationsNamespace('DoctrineMigrations'); |
| 583 | 583 | |
| 584 | - $migrationDir = __DIR__ . '/../../Resource/doctrine/migration'; |
|
| 584 | + $migrationDir = __DIR__.'/../../Resource/doctrine/migration'; |
|
| 585 | 585 | $config->setMigrationsDirectory($migrationDir); |
| 586 | 586 | $config->registerMigrationsFromDirectory($migrationDir); |
| 587 | 587 | |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | private function getProtectedDirs() |
| 614 | 614 | { |
| 615 | 615 | $protectedDirs = array(); |
| 616 | - $base = __DIR__ . '/../../../..'; |
|
| 616 | + $base = __DIR__.'/../../../..'; |
|
| 617 | 617 | $dirs = array( |
| 618 | 618 | '/html', |
| 619 | 619 | '/app', |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | ); |
| 627 | 627 | |
| 628 | 628 | foreach ($dirs as $dir) { |
| 629 | - if (!is_writable($base . $dir)) { |
|
| 629 | + if (!is_writable($base.$dir)) { |
|
| 630 | 630 | $protectedDirs[] = $dir; |
| 631 | 631 | } |
| 632 | 632 | } |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | private function createConfigYamlFile($data, $auth = true) |
| 638 | 638 | { |
| 639 | 639 | $fs = new Filesystem(); |
| 640 | - $config_file = $this->config_path . '/config.yml'; |
|
| 640 | + $config_file = $this->config_path.'/config.yml'; |
|
| 641 | 641 | |
| 642 | 642 | if ($fs->exists($config_file)) { |
| 643 | 643 | $config = Yaml::parse(file_get_contents($config_file)); |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | |
| 667 | 667 | $fs = new Filesystem(); |
| 668 | 668 | $content = str_replace( |
| 669 | - $target, $replace, file_get_contents($this->dist_path . '/config.yml.dist') |
|
| 669 | + $target, $replace, file_get_contents($this->dist_path.'/config.yml.dist') |
|
| 670 | 670 | ); |
| 671 | 671 | $fs->dumpFile($config_file, $content); |
| 672 | 672 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | |
| 681 | 681 | private function addInstallStatus() |
| 682 | 682 | { |
| 683 | - $config_file = $this->config_path . '/config.yml'; |
|
| 683 | + $config_file = $this->config_path.'/config.yml'; |
|
| 684 | 684 | $config = Yaml::parse(file_get_contents($config_file)); |
| 685 | 685 | $config['eccube_install'] = 1; |
| 686 | 686 | $yml = Yaml::dump($config); |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | private function createDatabaseYamlFile($data) |
| 693 | 693 | { |
| 694 | 694 | $fs = new Filesystem(); |
| 695 | - $config_file = $this->config_path . '/database.yml'; |
|
| 695 | + $config_file = $this->config_path.'/database.yml'; |
|
| 696 | 696 | if ($fs->exists($config_file)) { |
| 697 | 697 | $fs->remove($config_file); |
| 698 | 698 | } |
@@ -725,14 +725,14 @@ discard block |
||
| 725 | 725 | |
| 726 | 726 | $fs = new Filesystem(); |
| 727 | 727 | $content = str_replace( |
| 728 | - $target, $replace, file_get_contents($this->dist_path . '/database.yml.dist') |
|
| 728 | + $target, $replace, file_get_contents($this->dist_path.'/database.yml.dist') |
|
| 729 | 729 | ); |
| 730 | 730 | } else { |
| 731 | 731 | $content = Yaml::dump( |
| 732 | 732 | array( |
| 733 | 733 | 'database' => array( |
| 734 | 734 | 'driver' => 'pdo_sqlite', |
| 735 | - 'path' => realpath($this->config_path . '/eccube.db') |
|
| 735 | + 'path' => realpath($this->config_path.'/eccube.db') |
|
| 736 | 736 | ) |
| 737 | 737 | ) |
| 738 | 738 | ); |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | private function createMailYamlFile($data) |
| 746 | 746 | { |
| 747 | 747 | $fs = new Filesystem(); |
| 748 | - $config_file = $this->config_path . '/mail.yml'; |
|
| 748 | + $config_file = $this->config_path.'/mail.yml'; |
|
| 749 | 749 | if ($fs->exists($config_file)) { |
| 750 | 750 | $fs->remove($config_file); |
| 751 | 751 | } |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | |
| 761 | 761 | $fs = new Filesystem(); |
| 762 | 762 | $content = str_replace( |
| 763 | - $target, $replace, file_get_contents($this->dist_path . '/mail.yml.dist') |
|
| 763 | + $target, $replace, file_get_contents($this->dist_path.'/mail.yml.dist') |
|
| 764 | 764 | ); |
| 765 | 765 | $fs->dumpFile($config_file, $content); |
| 766 | 766 | |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | private function createPathYamlFile($data, Request $request) |
| 771 | 771 | { |
| 772 | 772 | $fs = new Filesystem(); |
| 773 | - $config_file = $this->config_path . '/path.yml'; |
|
| 773 | + $config_file = $this->config_path.'/path.yml'; |
|
| 774 | 774 | if ($fs->exists($config_file)) { |
| 775 | 775 | $fs->remove($config_file); |
| 776 | 776 | } |
@@ -778,16 +778,16 @@ discard block |
||
| 778 | 778 | $ADMIN_ROUTE = $data['admin_dir']; |
| 779 | 779 | $TEMPLATE_CODE = 'default'; |
| 780 | 780 | $USER_DATA_ROUTE = 'user_data'; |
| 781 | - $ROOT_DIR = realpath(__DIR__ . '/../../../../'); |
|
| 781 | + $ROOT_DIR = realpath(__DIR__.'/../../../../'); |
|
| 782 | 782 | $ROOT_URLPATH = $request->getBasePath(); |
| 783 | - $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH . RELATIVE_PUBLIC_DIR_PATH; |
|
| 783 | + $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH.RELATIVE_PUBLIC_DIR_PATH; |
|
| 784 | 784 | |
| 785 | 785 | $target = array('${ADMIN_ROUTE}', '${TEMPLATE_CODE}', '${USER_DATA_ROUTE}', '${ROOT_DIR}', '${ROOT_URLPATH}', '${ROOT_PUBLIC_URLPATH}'); |
| 786 | 786 | $replace = array($ADMIN_ROUTE, $TEMPLATE_CODE, $USER_DATA_ROUTE, $ROOT_DIR, $ROOT_URLPATH, $ROOT_PUBLIC_URLPATH); |
| 787 | 787 | |
| 788 | 788 | $fs = new Filesystem(); |
| 789 | 789 | $content = str_replace( |
| 790 | - $target, $replace, file_get_contents($this->dist_path . '/path.yml.dist') |
|
| 790 | + $target, $replace, file_get_contents($this->dist_path.'/path.yml.dist') |
|
| 791 | 791 | ); |
| 792 | 792 | $fs->dumpFile($config_file, $content); |
| 793 | 793 | |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | |
| 797 | 797 | private function sendAppData($params) |
| 798 | 798 | { |
| 799 | - $config_file = $this->config_path . '/database.yml'; |
|
| 799 | + $config_file = $this->config_path.'/database.yml'; |
|
| 800 | 800 | $db_config = Yaml::parse(file_get_contents($config_file)); |
| 801 | 801 | |
| 802 | 802 | $this->setPDO(); |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | if ($db_config['database']['driver'] === 'pdo_mysql') { |
| 811 | - $db_ver = 'MySQL:' . $version; |
|
| 811 | + $db_ver = 'MySQL:'.$version; |
|
| 812 | 812 | } else { |
| 813 | 813 | $db_ver = $version; |
| 814 | 814 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | |
| 827 | 827 | $header = array( |
| 828 | 828 | 'Content-Type: application/x-www-form-urlencoded', |
| 829 | - 'Content-Length: ' . strlen($data), |
|
| 829 | + 'Content-Length: '.strlen($data), |
|
| 830 | 830 | ); |
| 831 | 831 | $context = stream_context_create( |
| 832 | 832 | array( |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | public function migration(InstallApplication $app, Request $request) |
| 854 | 854 | { |
| 855 | 855 | return $app['twig']->render('migration.twig', array( |
| 856 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 856 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 857 | 857 | )); |
| 858 | 858 | } |
| 859 | 859 | |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | return $app['twig']->render('migration_plugin.twig', array( |
| 883 | 883 | 'Plugins' => $Plugins, |
| 884 | 884 | 'version' => Constant::VERSION, |
| 885 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 885 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 886 | 886 | )); |
| 887 | 887 | } |
| 888 | 888 | } |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | \Eccube\Util\Cache::clear($config_app, true); |
| 906 | 906 | |
| 907 | 907 | return $app['twig']->render('migration_end.twig', array( |
| 908 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 908 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 909 | 909 | )); |
| 910 | 910 | } |
| 911 | 911 | } |
@@ -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; |
@@ -36,6 +36,9 @@ |
||
| 36 | 36 | { |
| 37 | 37 | protected $app; |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param \Silex\Application $app |
|
| 41 | + */ |
|
| 39 | 42 | public function __construct($app) |
| 40 | 43 | { |
| 41 | 44 | $this->app = $app; |
@@ -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 | { |