@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace Eccube; |
25 | 25 | |
26 | -use Composer\Autoload\ClassLoader; |
|
27 | 26 | use Doctrine\DBAL\Types\Type; |
28 | 27 | use Eccube\Di\Scanner\ComponentScanner; |
29 | 28 | use Eccube\Di\Scanner\EntityEventScanner; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $this->register(new MobileDetectServiceProvider()); |
183 | 183 | $this->register(new TwigLintServiceProvider()); |
184 | 184 | |
185 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
185 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
186 | 186 | if ($this['debug']) { |
187 | 187 | return; |
188 | 188 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | $pluginSubDirs = (function($dirName) use ($enabledPluginDirs) { |
251 | 251 | return array_map(function($pluginDir) use ($dirName) { |
252 | - return $pluginDir . '/' . $dirName; |
|
252 | + return $pluginDir.'/'.$dirName; |
|
253 | 253 | }, $enabledPluginDirs); |
254 | 254 | }); |
255 | 255 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | return $router; |
317 | 317 | }); |
318 | 318 | |
319 | - $this['eccube.router.origin'] = function ($app) { |
|
319 | + $this['eccube.router.origin'] = function($app) { |
|
320 | 320 | $resource = __DIR__.'/Controller'; |
321 | 321 | $cachePrefix = 'Origin'; |
322 | 322 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | $this['eccube.routers.plugin'] = []; |
327 | 327 | |
328 | - $this['eccube.router.extend'] = function ($app) { |
|
328 | + $this['eccube.router.extend'] = function($app) { |
|
329 | 329 | // TODO ディレクトリ名は暫定 |
330 | 330 | $resource = $app['config']['root_dir'].'/app/'.$app['config']['vendor_dir'].'Controller'; |
331 | 331 | $cachePrefix = 'Extend'; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | return $router; |
336 | 336 | }; |
337 | 337 | |
338 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
338 | + $this->extend('request_matcher', function($matcher, $app) { |
|
339 | 339 | $matchers = []; |
340 | 340 | $matchers[] = $app['eccube.router.extend']; |
341 | 341 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | return new ChainUrlMatcher($matchers, $app['request_context']); |
348 | 348 | }); |
349 | 349 | |
350 | - $this->extend('url_generator', function ($generator, $app) { |
|
350 | + $this->extend('url_generator', function($generator, $app) { |
|
351 | 351 | $generators = []; |
352 | 352 | $generators[] = $app['eccube.router.extend']; |
353 | 353 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | }); |
361 | 361 | |
362 | 362 | // Route CollectionにEC-CUBEで定義したルーティングを追加(debug tool barに出力するため) |
363 | - $this->extend('routes', function ($routes, $app) { |
|
363 | + $this->extend('routes', function($routes, $app) { |
|
364 | 364 | $routes->addCollection($app['eccube.router.extend']->getRouteCollection()); |
365 | 365 | foreach ($app['eccube.routers.plugin'] as $router) { |
366 | 366 | $routes->addCollection($router->getRouteCollection()); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
394 | 394 | 'locale_fallbacks' => ['ja', 'en'], |
395 | 395 | )); |
396 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
396 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
397 | 397 | $translator->addLoader('php', new \Symfony\Component\Translation\Loader\PhpFileLoader()); |
398 | 398 | |
399 | 399 | $file = __DIR__.'/Resource/locale/messages.'.$app['locale'].'.php'; |
@@ -436,14 +436,14 @@ discard block |
||
436 | 436 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
437 | 437 | 'twig.form.templates' => array('Form/form_layout.twig'), |
438 | 438 | )); |
439 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
439 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
440 | 440 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
441 | 441 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
442 | 442 | |
443 | 443 | return $twig; |
444 | 444 | }); |
445 | 445 | |
446 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
446 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
447 | 447 | $app['admin'] = $app['front'] = false; |
448 | 448 | $pathinfo = rawurldecode($request->getPathInfo()); |
449 | 449 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | $paths[] = $app['config']['template_admin_realdir']; |
461 | 461 | $paths[] = __DIR__.'/../../app/Plugin'; |
462 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
462 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
463 | 463 | } else { |
464 | 464 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
465 | 465 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | } |
475 | 475 | $paths[] = $app['config']['template_default_realdir']; |
476 | 476 | $paths[] = __DIR__.'/../../app/Plugin'; |
477 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
477 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
478 | 478 | } |
479 | 479 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
480 | 480 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | }, self::EARLY_EVENT); |
493 | 493 | |
494 | 494 | // twigのグローバル変数を定義. |
495 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
495 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
496 | 496 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
497 | 497 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
498 | 498 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
578 | 578 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
579 | 579 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
580 | - \Swift::init(function () { |
|
580 | + \Swift::init(function() { |
|
581 | 581 | \Swift_DependencyContainer::getInstance() |
582 | 582 | ->register('mime.qpheaderencoder') |
583 | 583 | ->asAliasOf('mime.base64headerencoder'); |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
613 | 613 | |
614 | 614 | $app = $this; |
615 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
615 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
616 | 616 | $initSubscriber = new InitSubscriber($app); |
617 | 617 | $evm->addEventSubscriber($initSubscriber); |
618 | 618 | |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | |
728 | 728 | $this->extend( |
729 | 729 | 'orm.em.config', |
730 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
730 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
731 | 731 | |
732 | 732 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
733 | 733 | $chain = $config->getMetadataDriverImpl(); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | } |
750 | 750 | ); |
751 | 751 | |
752 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
752 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
753 | 753 | // save |
754 | 754 | $saveEventSubscriber = new \Eccube\Doctrine\EventSubscriber\SaveEventSubscriber($app); |
755 | 755 | $em->getEventManager()->addEventSubscriber($saveEventSubscriber); |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | // second level cacheの設定. |
775 | 775 | $this->extend( |
776 | 776 | 'orm.em.config', |
777 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
777 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
778 | 778 | $config->setSecondLevelCacheEnabled(); |
779 | 779 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
780 | 780 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -863,31 +863,31 @@ discard block |
||
863 | 863 | array('^/mypage', 'ROLE_USER', $channel), |
864 | 864 | ); |
865 | 865 | |
866 | - $this['eccube.password_encoder'] = function ($app) { |
|
866 | + $this['eccube.password_encoder'] = function($app) { |
|
867 | 867 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
868 | 868 | }; |
869 | - $this['security.encoder_factory'] = function ($app) { |
|
869 | + $this['security.encoder_factory'] = function($app) { |
|
870 | 870 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
871 | 871 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
872 | 872 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
873 | 873 | )); |
874 | 874 | }; |
875 | - $this['eccube.event_listner.security'] = function ($app) { |
|
875 | + $this['eccube.event_listner.security'] = function($app) { |
|
876 | 876 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
877 | 877 | }; |
878 | 878 | |
879 | 879 | // Voterの設定 |
880 | - $this['authority_voter'] = function ($app) { |
|
880 | + $this['authority_voter'] = function($app) { |
|
881 | 881 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
882 | 882 | }; |
883 | 883 | |
884 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
884 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
885 | 885 | $voters[] = $app['authority_voter']; |
886 | 886 | |
887 | 887 | return $voters; |
888 | 888 | }); |
889 | 889 | |
890 | - $this['security.access_manager'] = function ($app) { |
|
890 | + $this['security.access_manager'] = function($app) { |
|
891 | 891 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
892 | 892 | }; |
893 | 893 | |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | { |
902 | 902 | $config = $this['config']; |
903 | 903 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
904 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
904 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
905 | 905 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
906 | 906 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
907 | 907 | }, self::EARLY_EVENT); |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | $this->register(new ServiceProvider\EccubePluginServiceProvider()); |
919 | 919 | |
920 | 920 | // TODO Acme\ServiceProvider の初期化はここで OK? |
921 | - if (array_key_exists('service',$this['config'])) { |
|
921 | + if (array_key_exists('service', $this['config'])) { |
|
922 | 922 | foreach ($this['config']['service'] as $service) { |
923 | 923 | $this->register(new $service); |
924 | 924 | } |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | $app = $this; |
1056 | 1056 | |
1057 | 1057 | // Response Event(http cache対応、event実行は一番遅く設定) |
1058 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1058 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1059 | 1059 | |
1060 | 1060 | if (!$event->isMasterRequest()) { |
1061 | 1061 | return; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $loader = require __DIR__.'/autoload.php'; |
26 | 26 | |
27 | 27 | ini_set('display_errors', 'Off'); |
28 | -error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); |
|
28 | +error_reporting(E_ALL&~E_DEPRECATED&~E_STRICT); |
|
29 | 29 | |
30 | 30 | // see http://silex.sensiolabs.org/doc/web_servers.html#php-5-4 |
31 | 31 | $filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | out('EC-CUBE3 installer use database driver of ', null, false); |
32 | 32 | |
33 | 33 | $database_driver = 'pdo_sqlite'; |
34 | -switch($argv[1]) { |
|
34 | +switch ($argv[1]) { |
|
35 | 35 | case 'mysql': |
36 | 36 | $database_driver = 'pdo_mysql'; |
37 | 37 | break; |
@@ -166,8 +166,7 @@ discard block |
||
166 | 166 | putenv('MAIL_PASS='.(getenv('MAIL_PASS') ? getenv('MAIL_PASS') : null)); |
167 | 167 | putenv('ADMIN_ROUTE='.(getenv('ADMIN_ROUTE') ? getenv('ADMIN_ROUTE') : 'admin')); |
168 | 168 | putenv('ROOT_URLPATH='.(getenv('ROOT_URLPATH') ? getenv('ROOT_URLPATH') : null)); |
169 | - putenv('AUTH_MAGIC='.(getenv('AUTH_MAGIC') ? getenv('AUTH_MAGIC') : |
|
170 | - substr(str_replace(array('/', '+', '='), '', base64_encode(openssl_random_pseudo_bytes(32 * 2))), 0, 32))); |
|
169 | + putenv('AUTH_MAGIC='.(getenv('AUTH_MAGIC') ? getenv('AUTH_MAGIC') : substr(str_replace(array('/', '+', '='), '', base64_encode(openssl_random_pseudo_bytes(32 * 2))), 0, 32))); |
|
171 | 170 | } |
172 | 171 | |
173 | 172 | function getExampleVariables() |
@@ -277,7 +276,7 @@ discard block |
||
277 | 276 | { |
278 | 277 | $app = \Eccube\Application::getInstance(['eccube.autoloader' => $loader]); |
279 | 278 | $app['debug'] = true; |
280 | - $app['annotations'] = function () { |
|
279 | + $app['annotations'] = function() { |
|
281 | 280 | return new \Doctrine\Common\Annotations\AnnotationReader(); |
282 | 281 | }; |
283 | 282 | $app->initDoctrine(); |
@@ -388,15 +387,15 @@ discard block |
||
388 | 387 | foreach ($finder as $content) { |
389 | 388 | $permission = $content->getPerms(); |
390 | 389 | // see also http://www.php.net/fileperms |
391 | - if (!($permission & 0x0010) || !($permission & 0x0002)) { |
|
390 | + if (!($permission&0x0010) || !($permission&0x0002)) { |
|
392 | 391 | $realPath = $content->getRealPath(); |
393 | 392 | if ($verbose) { |
394 | 393 | out(sprintf('%s %s to ', $realPath, substr(sprintf('%o', $permission), -4)), 'info', false); |
395 | 394 | } |
396 | - $permission = !($permission & 0x0020) ? $permission += 040 : $permission; // g+r |
|
397 | - $permission = !($permission & 0x0010) ? $permission += 020 : $permission; // g+w |
|
398 | - $permission = !($permission & 0x0004) ? $permission += 04 : $permission; // o+r |
|
399 | - $permission = !($permission & 0x0002) ? $permission += 02 : $permission; // o+w |
|
395 | + $permission = !($permission&0x0020) ? $permission += 040 : $permission; // g+r |
|
396 | + $permission = !($permission&0x0010) ? $permission += 020 : $permission; // g+w |
|
397 | + $permission = !($permission&0x0004) ? $permission += 04 : $permission; // o+r |
|
398 | + $permission = !($permission&0x0002) ? $permission += 02 : $permission; // o+w |
|
400 | 399 | $result = chmod($realPath, $permission); |
401 | 400 | if ($verbose) { |
402 | 401 | if ($result) { |
@@ -428,13 +427,13 @@ discard block |
||
428 | 427 | |
429 | 428 | function getConfig() |
430 | 429 | { |
431 | - $config = array ( |
|
430 | + $config = array( |
|
432 | 431 | 'auth_magic' => getenv('AUTH_MAGIC'), |
433 | 432 | 'password_hash_algos' => 'sha256', |
434 | 433 | 'shop_name' => getenv('SHOP_NAME'), |
435 | 434 | 'force_ssl' => NULL, |
436 | 435 | 'admin_allow_host' => |
437 | - array ( |
|
436 | + array( |
|
438 | 437 | ), |
439 | 438 | 'cookie_lifetime' => 0, |
440 | 439 | 'locale' => 'ja', |
@@ -447,9 +446,9 @@ discard block |
||
447 | 446 | |
448 | 447 | function getDatabaseConfig($database_driver) |
449 | 448 | { |
450 | - $database = array ( |
|
449 | + $database = array( |
|
451 | 450 | 'database' => |
452 | - array ( |
|
451 | + array( |
|
453 | 452 | 'driver' => $database_driver, |
454 | 453 | ) |
455 | 454 | ); |
@@ -476,9 +475,9 @@ discard block |
||
476 | 475 | |
477 | 476 | function getMailConfig() |
478 | 477 | { |
479 | - $mail = array ( |
|
478 | + $mail = array( |
|
480 | 479 | 'mail' => |
481 | - array ( |
|
480 | + array( |
|
482 | 481 | 'transport' => getenv('MAIL_BACKEND'), |
483 | 482 | 'host' => getenv('MAIL_HOST'), |
484 | 483 | 'port' => getenv('MAIL_PORT'), |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php return [ |
2 | - 'auth_magic' => '${AUTH_MAGIC}', |
|
3 | - 'password_hash_algos' => 'sha256', |
|
4 | - 'shop_name' => '${SHOP_NAME}', |
|
5 | - 'force_ssl' => '${FORCE_SSL}', |
|
6 | - 'admin_allow_host' => NULL, |
|
7 | - 'cookie_lifetime' => 0, |
|
8 | - 'cookie_name' => 'eccube', |
|
9 | - 'locale' => 'ja', |
|
10 | - 'timezone' => 'Asia/Tokyo', |
|
11 | - 'currency' => 'JPY', |
|
12 | - 'pageinrange' => false, |
|
13 | - 'trusted_proxies_connection_only' => false, |
|
14 | - 'trusted_proxies' => |
|
15 | - [ |
|
16 | - ], |
|
17 | - 'vendor_prefix' => 'Acme\\', |
|
18 | - 'vendor_dir' => 'Acme/', |
|
2 | + 'auth_magic' => '${AUTH_MAGIC}', |
|
3 | + 'password_hash_algos' => 'sha256', |
|
4 | + 'shop_name' => '${SHOP_NAME}', |
|
5 | + 'force_ssl' => '${FORCE_SSL}', |
|
6 | + 'admin_allow_host' => NULL, |
|
7 | + 'cookie_lifetime' => 0, |
|
8 | + 'cookie_name' => 'eccube', |
|
9 | + 'locale' => 'ja', |
|
10 | + 'timezone' => 'Asia/Tokyo', |
|
11 | + 'currency' => 'JPY', |
|
12 | + 'pageinrange' => false, |
|
13 | + 'trusted_proxies_connection_only' => false, |
|
14 | + 'trusted_proxies' => |
|
15 | + [ |
|
16 | + ], |
|
17 | + 'vendor_prefix' => 'Acme\\', |
|
18 | + 'vendor_dir' => 'Acme/', |
|
19 | 19 | ]; |