@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Doctrine\Common\DataFixtures\FixtureInterface; |
| 6 | 6 | use Doctrine\Common\Persistence\ObjectManager; |
| 7 | 7 | use Doctrine\DBAL\Connection; |
| 8 | -use Doctrine\DBAL\Schema\Table; |
|
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * CSVファイルを扱うためのフィクスチャ. |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function load(ObjectManager $manager) |
| 29 | 29 | { |
| 30 | 30 | // CSV Reader に設定 |
| 31 | - $this->file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::READ_AHEAD | \SplFileObject::SKIP_EMPTY); |
|
| 31 | + $this->file->setFlags(\SplFileObject::READ_CSV|\SplFileObject::READ_AHEAD|\SplFileObject::SKIP_EMPTY); |
|
| 32 | 32 | |
| 33 | 33 | // ヘッダ行を取得 |
| 34 | 34 | $headers = $this->file->current(); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | ->name('*.csv') |
| 44 | 44 | ->sort( |
| 45 | 45 | // 定義ファイルに記載の順にソート. |
| 46 | - function (\SplFileInfo $a, \SplFileInfo $b) use ($definition) { |
|
| 46 | + function(\SplFileInfo $a, \SplFileInfo $b) use ($definition) { |
|
| 47 | 47 | if (!isset($definition[$a->getFilename()])) { |
| 48 | 48 | throw new \Exception(sprintf('"%s" is undefined in %s', $a->getFilename())); |
| 49 | 49 | } |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function __construct() |
| 63 | 63 | { |
| 64 | - $this->config_path = __DIR__ . '/../../../../app/config/eccube'; |
|
| 65 | - $this->dist_path = __DIR__ . '/../../Resource/config'; |
|
| 66 | - $this->cache_path = __DIR__ . '/../../../../app/cache'; |
|
| 64 | + $this->config_path = __DIR__.'/../../../../app/config/eccube'; |
|
| 65 | + $this->dist_path = __DIR__.'/../../Resource/config'; |
|
| 66 | + $this->cache_path = __DIR__.'/../../../../app/cache'; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | private function isValid(Request $request, Form $form) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | return $app['twig']->render('step1.twig', array( |
| 115 | 115 | 'form' => $form->createView(), |
| 116 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 116 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 117 | 117 | )); |
| 118 | 118 | } |
| 119 | 119 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | return $app['twig']->render('step2.twig', array( |
| 138 | 138 | 'protectedDirs' => $protectedDirs, |
| 139 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 139 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 140 | 140 | )); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | if (empty($sessionData['shop_name'])) { |
| 152 | 152 | |
| 153 | - $config_file = $this->config_path . '/config.yml'; |
|
| 153 | + $config_file = $this->config_path.'/config.yml'; |
|
| 154 | 154 | $fs = new Filesystem(); |
| 155 | 155 | |
| 156 | 156 | if ($fs->exists($config_file)) { |
@@ -164,11 +164,11 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // セキュリティの設定 |
| 167 | - $config_file = $this->config_path . '/path.yml'; |
|
| 167 | + $config_file = $this->config_path.'/path.yml'; |
|
| 168 | 168 | $config = Yaml::parse(file_get_contents($config_file)); |
| 169 | 169 | $sessionData['admin_dir'] = $config['admin_route']; |
| 170 | 170 | |
| 171 | - $config_file = $this->config_path . '/config.yml'; |
|
| 171 | + $config_file = $this->config_path.'/config.yml'; |
|
| 172 | 172 | $config = Yaml::parse(file_get_contents($config_file)); |
| 173 | 173 | |
| 174 | 174 | $allowHost = $config['admin_allow_host']; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | // ロードバランサー、プロキシサーバ設定 |
| 181 | 181 | if (isset($config['trusted_proxies_connection_only'])) { |
| 182 | - $sessionData['trusted_proxies_connection_only'] = (bool)$config['trusted_proxies_connection_only']; |
|
| 182 | + $sessionData['trusted_proxies_connection_only'] = (bool) $config['trusted_proxies_connection_only']; |
|
| 183 | 183 | } |
| 184 | 184 | if (isset($config['trusted_proxies'])) { |
| 185 | 185 | $trustedProxies = $config['trusted_proxies']; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | // メール設定 |
| 191 | - $config_file = $this->config_path . '/mail.yml'; |
|
| 191 | + $config_file = $this->config_path.'/mail.yml'; |
|
| 192 | 192 | $config = Yaml::parse(file_get_contents($config_file)); |
| 193 | 193 | $mail = $config['mail']; |
| 194 | 194 | $sessionData['mail_backend'] = $mail['transport']; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | return $app['twig']->render('step3.twig', array( |
| 213 | 213 | 'form' => $form->createView(), |
| 214 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 214 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 215 | 215 | )); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | if (empty($sessionData['database'])) { |
| 228 | 228 | |
| 229 | - $config_file = $this->config_path . '/database.yml'; |
|
| 229 | + $config_file = $this->config_path.'/database.yml'; |
|
| 230 | 230 | $fs = new Filesystem(); |
| 231 | 231 | |
| 232 | 232 | if ($fs->exists($config_file)) { |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | return $app['twig']->render('step4.twig', array( |
| 256 | 256 | 'form' => $form->createView(), |
| 257 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 257 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 258 | 258 | )); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $host = $request->getSchemeAndHttpHost(); |
| 302 | 302 | $basePath = $request->getBasePath(); |
| 303 | 303 | $params = array( |
| 304 | - 'http_url' => $host . $basePath, |
|
| 304 | + 'http_url' => $host.$basePath, |
|
| 305 | 305 | 'shop_name' => $sessionData['shop_name'], |
| 306 | 306 | ); |
| 307 | 307 | |
@@ -316,16 +316,16 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | return $app['twig']->render('step5.twig', array( |
| 318 | 318 | 'form' => $form->createView(), |
| 319 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 319 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 320 | 320 | )); |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | // インストール完了 |
| 324 | 324 | public function complete(InstallApplication $app, Request $request) |
| 325 | 325 | { |
| 326 | - $config_yml = $this->config_path . '/config.yml'; |
|
| 326 | + $config_yml = $this->config_path.'/config.yml'; |
|
| 327 | 327 | $config = Yaml::parse(file_get_contents($config_yml)); |
| 328 | - $config_path = $this->config_path . '/path.yml'; |
|
| 328 | + $config_path = $this->config_path.'/path.yml'; |
|
| 329 | 329 | $path_yml = Yaml::parse(file_get_contents($config_path)); |
| 330 | 330 | |
| 331 | 331 | $config = array_replace_recursive($path_yml, $config); |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | $host = $request->getSchemeAndHttpHost(); |
| 341 | 341 | $basePath = $request->getBasePath(); |
| 342 | 342 | |
| 343 | - $adminUrl = $host . $basePath . '/' . $config['admin_dir']; |
|
| 343 | + $adminUrl = $host.$basePath.'/'.$config['admin_dir']; |
|
| 344 | 344 | |
| 345 | 345 | return $app['twig']->render('complete.twig', array( |
| 346 | 346 | 'admin_url' => $adminUrl, |
| 347 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 347 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 348 | 348 | )); |
| 349 | 349 | } |
| 350 | 350 | |
@@ -360,12 +360,12 @@ discard block |
||
| 360 | 360 | { |
| 361 | 361 | foreach ($this->required_modules as $module) { |
| 362 | 362 | if (!extension_loaded($module)) { |
| 363 | - $app->addDanger('[必須] ' . $module . ' 拡張モジュールが有効になっていません。', 'install'); |
|
| 363 | + $app->addDanger('[必須] '.$module.' 拡張モジュールが有効になっていません。', 'install'); |
|
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | if (!extension_loaded('pdo_mysql') && !extension_loaded('pdo_pgsql')) { |
| 368 | - $app->addDanger('[必須] ' . 'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
| 368 | + $app->addDanger('[必須] '.'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | foreach ($this->recommended_module as $module) { |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | if (!function_exists('apache_get_modules')) { |
| 394 | 394 | $app->addWarning('mod_rewrite が有効になっているか不明です。', 'install'); |
| 395 | 395 | } elseif (!in_array('mod_rewrite', apache_get_modules())) { |
| 396 | - $app->addDanger('[必須] ' . 'mod_rewriteを有効にしてください。', 'install'); |
|
| 396 | + $app->addDanger('[必須] '.'mod_rewriteを有効にしてください。', 'install'); |
|
| 397 | 397 | } |
| 398 | 398 | } elseif (isset($_SERVER['SERVER_SOFTWARE']) && strpos('Microsoft-IIS', $_SERVER['SERVER_SOFTWARE']) !== false) { |
| 399 | 399 | // iis |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | private function setPDO() |
| 406 | 406 | { |
| 407 | - $config_file = $this->config_path . '/database.yml'; |
|
| 407 | + $config_file = $this->config_path.'/database.yml'; |
|
| 408 | 408 | $config = Yaml::parse(file_get_contents($config_file)); |
| 409 | 409 | |
| 410 | 410 | try { |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | private function getEntityManager() |
| 440 | 440 | { |
| 441 | 441 | if (!isset($this->app['orm.em'])) { |
| 442 | - $config_file = $this->config_path . '/database.yml'; |
|
| 442 | + $config_file = $this->config_path.'/database.yml'; |
|
| 443 | 443 | $database = Yaml::parse(file_get_contents($config_file)); |
| 444 | 444 | |
| 445 | 445 | $this->app->register(new \Silex\Provider\DoctrineServiceProvider(), array( |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | 'type' => 'yml', |
| 452 | 452 | 'namespace' => 'Eccube\Entity', |
| 453 | 453 | 'path' => array( |
| 454 | - __DIR__ . '/../../Resource/doctrine', |
|
| 455 | - __DIR__ . '/../../Resource/doctrine/master', |
|
| 454 | + __DIR__.'/../../Resource/doctrine', |
|
| 455 | + __DIR__.'/../../Resource/doctrine/master', |
|
| 456 | 456 | ), |
| 457 | 457 | ), |
| 458 | 458 | array( // TODO 暫定 |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | $this->app->register(new \Dflydev\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), array( |
| 487 | - 'orm.proxies_dir' => __DIR__ . '/../../app/cache/doctrine', |
|
| 487 | + 'orm.proxies_dir' => __DIR__.'/../../app/cache/doctrine', |
|
| 488 | 488 | 'orm.em.options' => array( |
| 489 | 489 | 'mappings' => $ormMappings |
| 490 | 490 | ) |
@@ -524,11 +524,11 @@ discard block |
||
| 524 | 524 | { |
| 525 | 525 | $this->resetNatTimer(); |
| 526 | 526 | |
| 527 | - $config_file = $this->config_path . '/database.yml'; |
|
| 527 | + $config_file = $this->config_path.'/database.yml'; |
|
| 528 | 528 | $database = Yaml::parse(file_get_contents($config_file)); |
| 529 | 529 | $config['database'] = $database['database']; |
| 530 | 530 | |
| 531 | - $config_file = $this->config_path . '/config.yml'; |
|
| 531 | + $config_file = $this->config_path.'/config.yml'; |
|
| 532 | 532 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
| 533 | 533 | $config['config'] = $baseConfig; |
| 534 | 534 | |
@@ -586,11 +586,11 @@ discard block |
||
| 586 | 586 | { |
| 587 | 587 | $this->resetNatTimer(); |
| 588 | 588 | |
| 589 | - $config_file = $this->config_path . '/database.yml'; |
|
| 589 | + $config_file = $this->config_path.'/database.yml'; |
|
| 590 | 590 | $database = Yaml::parse(file_get_contents($config_file)); |
| 591 | 591 | $config['database'] = $database['database']; |
| 592 | 592 | |
| 593 | - $config_file = $this->config_path . '/config.yml'; |
|
| 593 | + $config_file = $this->config_path.'/config.yml'; |
|
| 594 | 594 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
| 595 | 595 | $config['config'] = $baseConfig; |
| 596 | 596 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $config = new Configuration($app['db']); |
| 654 | 654 | $config->setMigrationsNamespace('DoctrineMigrations'); |
| 655 | 655 | |
| 656 | - $migrationDir = __DIR__ . '/../../Resource/doctrine/migration'; |
|
| 656 | + $migrationDir = __DIR__.'/../../Resource/doctrine/migration'; |
|
| 657 | 657 | $config->setMigrationsDirectory($migrationDir); |
| 658 | 658 | $config->registerMigrationsFromDirectory($migrationDir); |
| 659 | 659 | |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | private function getProtectedDirs() |
| 686 | 686 | { |
| 687 | 687 | $protectedDirs = array(); |
| 688 | - $base = __DIR__ . '/../../../..'; |
|
| 688 | + $base = __DIR__.'/../../../..'; |
|
| 689 | 689 | $dirs = array( |
| 690 | 690 | '/html', |
| 691 | 691 | '/app', |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | ); |
| 699 | 699 | |
| 700 | 700 | foreach ($dirs as $dir) { |
| 701 | - if (!is_writable($base . $dir)) { |
|
| 701 | + if (!is_writable($base.$dir)) { |
|
| 702 | 702 | $protectedDirs[] = $dir; |
| 703 | 703 | } |
| 704 | 704 | } |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | private function createConfigYamlFile($data, $auth = true) |
| 710 | 710 | { |
| 711 | 711 | $fs = new Filesystem(); |
| 712 | - $config_file = $this->config_path . '/config.yml'; |
|
| 712 | + $config_file = $this->config_path.'/config.yml'; |
|
| 713 | 713 | |
| 714 | 714 | if ($fs->exists($config_file)) { |
| 715 | 715 | $config = Yaml::parse(file_get_contents($config_file)); |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | |
| 751 | 751 | $fs = new Filesystem(); |
| 752 | 752 | $content = str_replace( |
| 753 | - $target, $replace, file_get_contents($this->dist_path . '/config.yml.dist') |
|
| 753 | + $target, $replace, file_get_contents($this->dist_path.'/config.yml.dist') |
|
| 754 | 754 | ); |
| 755 | 755 | $fs->dumpFile($config_file, $content); |
| 756 | 756 | |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | |
| 767 | 767 | private function addInstallStatus() |
| 768 | 768 | { |
| 769 | - $config_file = $this->config_path . '/config.yml'; |
|
| 769 | + $config_file = $this->config_path.'/config.yml'; |
|
| 770 | 770 | $config = Yaml::parse(file_get_contents($config_file)); |
| 771 | 771 | $config['eccube_install'] = 1; |
| 772 | 772 | $yml = Yaml::dump($config); |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | private function createDatabaseYamlFile($data) |
| 779 | 779 | { |
| 780 | 780 | $fs = new Filesystem(); |
| 781 | - $config_file = $this->config_path . '/database.yml'; |
|
| 781 | + $config_file = $this->config_path.'/database.yml'; |
|
| 782 | 782 | if ($fs->exists($config_file)) { |
| 783 | 783 | $fs->remove($config_file); |
| 784 | 784 | } |
@@ -811,14 +811,14 @@ discard block |
||
| 811 | 811 | |
| 812 | 812 | $fs = new Filesystem(); |
| 813 | 813 | $content = str_replace( |
| 814 | - $target, $replace, file_get_contents($this->dist_path . '/database.yml.dist') |
|
| 814 | + $target, $replace, file_get_contents($this->dist_path.'/database.yml.dist') |
|
| 815 | 815 | ); |
| 816 | 816 | } else { |
| 817 | 817 | $content = Yaml::dump( |
| 818 | 818 | array( |
| 819 | 819 | 'database' => array( |
| 820 | 820 | 'driver' => 'pdo_sqlite', |
| 821 | - 'path' => realpath($this->config_path . '/eccube.db') |
|
| 821 | + 'path' => realpath($this->config_path.'/eccube.db') |
|
| 822 | 822 | ) |
| 823 | 823 | ) |
| 824 | 824 | ); |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | private function createMailYamlFile($data) |
| 832 | 832 | { |
| 833 | 833 | $fs = new Filesystem(); |
| 834 | - $config_file = $this->config_path . '/mail.yml'; |
|
| 834 | + $config_file = $this->config_path.'/mail.yml'; |
|
| 835 | 835 | if ($fs->exists($config_file)) { |
| 836 | 836 | $fs->remove($config_file); |
| 837 | 837 | } |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | |
| 847 | 847 | $fs = new Filesystem(); |
| 848 | 848 | $content = str_replace( |
| 849 | - $target, $replace, file_get_contents($this->dist_path . '/mail.yml.dist') |
|
| 849 | + $target, $replace, file_get_contents($this->dist_path.'/mail.yml.dist') |
|
| 850 | 850 | ); |
| 851 | 851 | $fs->dumpFile($config_file, $content); |
| 852 | 852 | |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | private function createPathYamlFile($data, Request $request) |
| 857 | 857 | { |
| 858 | 858 | $fs = new Filesystem(); |
| 859 | - $config_file = $this->config_path . '/path.yml'; |
|
| 859 | + $config_file = $this->config_path.'/path.yml'; |
|
| 860 | 860 | if ($fs->exists($config_file)) { |
| 861 | 861 | $fs->remove($config_file); |
| 862 | 862 | } |
@@ -864,16 +864,16 @@ discard block |
||
| 864 | 864 | $ADMIN_ROUTE = $data['admin_dir']; |
| 865 | 865 | $TEMPLATE_CODE = 'default'; |
| 866 | 866 | $USER_DATA_ROUTE = 'user_data'; |
| 867 | - $ROOT_DIR = realpath(__DIR__ . '/../../../../'); |
|
| 867 | + $ROOT_DIR = realpath(__DIR__.'/../../../../'); |
|
| 868 | 868 | $ROOT_URLPATH = $request->getBasePath(); |
| 869 | - $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH . RELATIVE_PUBLIC_DIR_PATH; |
|
| 869 | + $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH.RELATIVE_PUBLIC_DIR_PATH; |
|
| 870 | 870 | |
| 871 | 871 | $target = array('${ADMIN_ROUTE}', '${TEMPLATE_CODE}', '${USER_DATA_ROUTE}', '${ROOT_DIR}', '${ROOT_URLPATH}', '${ROOT_PUBLIC_URLPATH}'); |
| 872 | 872 | $replace = array($ADMIN_ROUTE, $TEMPLATE_CODE, $USER_DATA_ROUTE, $ROOT_DIR, $ROOT_URLPATH, $ROOT_PUBLIC_URLPATH); |
| 873 | 873 | |
| 874 | 874 | $fs = new Filesystem(); |
| 875 | 875 | $content = str_replace( |
| 876 | - $target, $replace, file_get_contents($this->dist_path . '/path.yml.dist') |
|
| 876 | + $target, $replace, file_get_contents($this->dist_path.'/path.yml.dist') |
|
| 877 | 877 | ); |
| 878 | 878 | $fs->dumpFile($config_file, $content); |
| 879 | 879 | |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | |
| 883 | 883 | private function sendAppData($params) |
| 884 | 884 | { |
| 885 | - $config_file = $this->config_path . '/database.yml'; |
|
| 885 | + $config_file = $this->config_path.'/database.yml'; |
|
| 886 | 886 | $db_config = Yaml::parse(file_get_contents($config_file)); |
| 887 | 887 | |
| 888 | 888 | $this->setPDO(); |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | if ($db_config['database']['driver'] === 'pdo_mysql') { |
| 897 | - $db_ver = 'MySQL:' . $version; |
|
| 897 | + $db_ver = 'MySQL:'.$version; |
|
| 898 | 898 | } else { |
| 899 | 899 | $db_ver = $version; |
| 900 | 900 | } |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | |
| 913 | 913 | $header = array( |
| 914 | 914 | 'Content-Type: application/x-www-form-urlencoded', |
| 915 | - 'Content-Length: ' . strlen($data), |
|
| 915 | + 'Content-Length: '.strlen($data), |
|
| 916 | 916 | ); |
| 917 | 917 | $context = stream_context_create( |
| 918 | 918 | array( |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | public function migration(InstallApplication $app, Request $request) |
| 940 | 940 | { |
| 941 | 941 | return $app['twig']->render('migration.twig', array( |
| 942 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 942 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 943 | 943 | )); |
| 944 | 944 | } |
| 945 | 945 | |
@@ -968,7 +968,7 @@ discard block |
||
| 968 | 968 | return $app['twig']->render('migration_plugin.twig', array( |
| 969 | 969 | 'Plugins' => $Plugins, |
| 970 | 970 | 'version' => Constant::VERSION, |
| 971 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 971 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 972 | 972 | )); |
| 973 | 973 | } |
| 974 | 974 | } |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | \Eccube\Util\Cache::clear($config_app, true); |
| 992 | 992 | |
| 993 | 993 | return $app['twig']->render('migration_end.twig', array( |
| 994 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
| 994 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
| 995 | 995 | )); |
| 996 | 996 | } |
| 997 | 997 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $this->register(new \Silex\Provider\ValidatorServiceProvider()); |
| 165 | 165 | $this->register(new MobileDetectServiceProvider()); |
| 166 | 166 | |
| 167 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
| 167 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
| 168 | 168 | if ($this['debug']) { |
| 169 | 169 | return; |
| 170 | 170 | } |
@@ -258,14 +258,14 @@ discard block |
||
| 258 | 258 | return $router; |
| 259 | 259 | }); |
| 260 | 260 | |
| 261 | - $this['eccube.router.origin'] = function ($app) { |
|
| 261 | + $this['eccube.router.origin'] = function($app) { |
|
| 262 | 262 | $resource = __DIR__.'/Controller'; |
| 263 | 263 | $cachePrefix = 'Origin'; |
| 264 | 264 | |
| 265 | 265 | return $app['eccube.router']($resource, $cachePrefix); |
| 266 | 266 | }; |
| 267 | 267 | |
| 268 | - $this['eccube.routers.plugin'] = function ($app) { |
|
| 268 | + $this['eccube.routers.plugin'] = function($app) { |
|
| 269 | 269 | // TODO 有効なプラグインを対象とする必要がある. |
| 270 | 270 | $dirs = Finder::create() |
| 271 | 271 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | return $routers; |
| 283 | 283 | }; |
| 284 | 284 | |
| 285 | - $this['eccube.router.extend'] = function ($app) { |
|
| 285 | + $this['eccube.router.extend'] = function($app) { |
|
| 286 | 286 | // TODO ディレクトリ名は暫定 |
| 287 | 287 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
| 288 | 288 | $cachePrefix = 'Extend'; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | return $router; |
| 293 | 293 | }; |
| 294 | 294 | |
| 295 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
| 295 | + $this->extend('request_matcher', function($matcher, $app) { |
|
| 296 | 296 | $matchers = []; |
| 297 | 297 | $matchers[] = $app['eccube.router.extend']; |
| 298 | 298 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | return new ChainUrlMatcher($matchers, $app['request_context']); |
| 305 | 305 | }); |
| 306 | 306 | |
| 307 | - $this->extend('url_generator', function ($generator, $app) { |
|
| 307 | + $this->extend('url_generator', function($generator, $app) { |
|
| 308 | 308 | $generators = []; |
| 309 | 309 | $generators[] = $app['eccube.router.extend']; |
| 310 | 310 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
| 336 | 336 | 'locale_fallbacks' => ['ja', 'en'], |
| 337 | 337 | )); |
| 338 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 338 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 339 | 339 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 340 | 340 | |
| 341 | 341 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -382,14 +382,14 @@ discard block |
||
| 382 | 382 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 383 | 383 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 384 | 384 | )); |
| 385 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 385 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 386 | 386 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 387 | 387 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 388 | 388 | |
| 389 | 389 | return $twig; |
| 390 | 390 | }); |
| 391 | 391 | |
| 392 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 392 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 393 | 393 | $app['admin'] = false; |
| 394 | 394 | $app['front'] = false; |
| 395 | 395 | $pathinfo = rawurldecode($request->getPathInfo()); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
| 422 | 422 | if (!$app->offsetExists('twig')) { |
| 423 | 423 | |
| 424 | - $app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 424 | + $app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 425 | 425 | $paths = array(); |
| 426 | 426 | |
| 427 | 427 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | }, self::EARLY_EVENT); |
| 469 | 469 | |
| 470 | 470 | // twigのグローバル変数を定義. |
| 471 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 471 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 472 | 472 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
| 473 | 473 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
| 474 | 474 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 536 | 536 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 537 | 537 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 538 | - \Swift::init(function () { |
|
| 538 | + \Swift::init(function() { |
|
| 539 | 539 | \Swift_DependencyContainer::getInstance() |
| 540 | 540 | ->register('mime.qpheaderencoder') |
| 541 | 541 | ->asAliasOf('mime.base64headerencoder'); |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | ), |
| 664 | 664 | )); |
| 665 | 665 | |
| 666 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 666 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 667 | 667 | // tax_rule |
| 668 | 668 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
| 669 | 669 | $taxRuleRepository->setApplication($app); |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | // second level cacheの設定. |
| 697 | 697 | $this->extend( |
| 698 | 698 | 'orm.em.config', |
| 699 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 699 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 700 | 700 | $config->setSecondLevelCacheEnabled(); |
| 701 | 701 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
| 702 | 702 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -785,31 +785,31 @@ discard block |
||
| 785 | 785 | array('^/mypage', 'ROLE_USER', $channel), |
| 786 | 786 | ); |
| 787 | 787 | |
| 788 | - $this['eccube.password_encoder'] = function ($app) { |
|
| 788 | + $this['eccube.password_encoder'] = function($app) { |
|
| 789 | 789 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
| 790 | 790 | }; |
| 791 | - $this['security.encoder_factory'] = function ($app) { |
|
| 791 | + $this['security.encoder_factory'] = function($app) { |
|
| 792 | 792 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
| 793 | 793 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
| 794 | 794 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
| 795 | 795 | )); |
| 796 | 796 | }; |
| 797 | - $this['eccube.event_listner.security'] = function ($app) { |
|
| 797 | + $this['eccube.event_listner.security'] = function($app) { |
|
| 798 | 798 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
| 799 | 799 | }; |
| 800 | 800 | |
| 801 | 801 | // Voterの設定 |
| 802 | - $this['authority_voter'] = function ($app) { |
|
| 802 | + $this['authority_voter'] = function($app) { |
|
| 803 | 803 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
| 804 | 804 | }; |
| 805 | 805 | |
| 806 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
| 806 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
| 807 | 807 | $voters[] = $app['authority_voter']; |
| 808 | 808 | |
| 809 | 809 | return $voters; |
| 810 | 810 | }); |
| 811 | 811 | |
| 812 | - $this['security.access_manager'] = function ($app) { |
|
| 812 | + $this['security.access_manager'] = function($app) { |
|
| 813 | 813 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
| 814 | 814 | }; |
| 815 | 815 | |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | { |
| 824 | 824 | $config = $this['config']; |
| 825 | 825 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
| 826 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
| 826 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
| 827 | 827 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
| 828 | 828 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
| 829 | 829 | }, self::EARLY_EVENT); |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | $app = $this; |
| 984 | 984 | |
| 985 | 985 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 986 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 986 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 987 | 987 | |
| 988 | 988 | if (!$event->isMasterRequest()) { |
| 989 | 989 | return; |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | $config->setMigrationsTableName(self::MIGRATION_TABLE_PREFIX.$pluginCode); |
| 19 | 19 | $migration = new Migration($config); |
| 20 | 20 | $migration->setNoMigrationException(true); |
| 21 | - // null 又は 'last' を渡すと最新バージョンまでマイグレートする |
|
| 22 | - // 0か'first'を渡すと最初に戻る |
|
| 21 | + // null 又は 'last' を渡すと最新バージョンまでマイグレートする |
|
| 22 | + // 0か'first'を渡すと最初に戻る |
|
| 23 | 23 | $migration->migrate($version, false); |
| 24 | 24 | |
| 25 | 25 | |
@@ -9,12 +9,12 @@ |
||
| 9 | 9 | |
| 10 | 10 | CONST MIGRATION_TABLE_PREFIX = 'migration_'; |
| 11 | 11 | |
| 12 | - public function migrationSchema($app,$migrationFilePath,$pluginCode,$version=null) |
|
| 12 | + public function migrationSchema($app, $migrationFilePath, $pluginCode, $version = null) |
|
| 13 | 13 | { |
| 14 | 14 | $config = new Configuration($app['db']); |
| 15 | 15 | $config->setMigrationsNamespace('DoctrineMigrations'); |
| 16 | 16 | $config->setMigrationsDirectory($migrationFilePath); |
| 17 | - $config->registerMigrationsFromDirectory($migrationFilePath ); |
|
| 17 | + $config->registerMigrationsFromDirectory($migrationFilePath); |
|
| 18 | 18 | $config->setMigrationsTableName(self::MIGRATION_TABLE_PREFIX.$pluginCode); |
| 19 | 19 | $migration = new Migration($config); |
| 20 | 20 | $migration->setNoMigrationException(true); |