@@ -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'].'/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) { |
@@ -26,7 +26,6 @@ |
||
| 26 | 26 | |
| 27 | 27 | use Eccube\Common\Constant; |
| 28 | 28 | use Eccube\Util\EntityUtil; |
| 29 | -use Symfony\Component\Form\FormFactory; |
|
| 30 | 29 | use Symfony\Component\HttpFoundation\Request; |
| 31 | 30 | |
| 32 | 31 | class CsvExportService |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | { |
| 308 | 308 | $config = $this->config; |
| 309 | 309 | |
| 310 | - return function ($value) use ($config) { |
|
| 310 | + return function($value) use ($config) { |
|
| 311 | 311 | return mb_convert_encoding( |
| 312 | 312 | (string) $value, $config['csv_export_encoding'], 'UTF-8' |
| 313 | 313 | ); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | if ($Conditions instanceof ArrayCollection) { |
| 432 | 432 | $Conditions = new ArrayCollection( |
| 433 | 433 | array_map( |
| 434 | - function ($Entity) use ($em) { |
|
| 434 | + function($Entity) use ($em) { |
|
| 435 | 435 | return $em->getRepository(get_class($Entity))->find($Entity->getId()); |
| 436 | 436 | }, $Conditions->toArray() |
| 437 | 437 | ) |
@@ -23,8 +23,6 @@ |
||
| 23 | 23 | |
| 24 | 24 | namespace Eccube\Service; |
| 25 | 25 | |
| 26 | -use Eccube\Application; |
|
| 27 | - |
|
| 28 | 26 | |
| 29 | 27 | /** |
| 30 | 28 | * Copyright (C) 2012-2014 David de Boer <[email protected]> |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $this->file = $file; |
| 119 | 119 | $this->file->setFlags( |
| 120 | - \SplFileObject::READ_CSV | |
|
| 121 | - \SplFileObject::SKIP_EMPTY | |
|
| 122 | - \SplFileObject::READ_AHEAD | |
|
| 120 | + \SplFileObject::READ_CSV| |
|
| 121 | + \SplFileObject::SKIP_EMPTY| |
|
| 122 | + \SplFileObject::READ_AHEAD| |
|
| 123 | 123 | \SplFileObject::DROP_NEW_LINE |
| 124 | 124 | ); |
| 125 | 125 | $this->file->setCsvControl( |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | if ($count > 1) { |
| 363 | 363 | $incrementedHeaders[] = $header; |
| 364 | 364 | for ($i = 1; $i < $count; $i++) { |
| 365 | - $incrementedHeaders[] = $header . $i; |
|
| 365 | + $incrementedHeaders[] = $header.$i; |
|
| 366 | 366 | } |
| 367 | 367 | } else { |
| 368 | 368 | $incrementedHeaders[] = $header; |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | protected function convertEncodingRows($row) { |
| 414 | 414 | if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) { |
| 415 | 415 | foreach ($row as &$col) { |
| 416 | - $col = mb_convert_encoding($col , 'UTF-8', 'SJIS-win'); |
|
| 416 | + $col = mb_convert_encoding($col, 'UTF-8', 'SJIS-win'); |
|
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | return $row; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | 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 | $app = new Eccube\Application(); |
| 31 | 31 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | // load config dev |
| 60 | 60 | $conf = $app['config']; |
| 61 | -$app['config'] = $app->share(function () use ($conf) { |
|
| 61 | +$app['config'] = $app->share(function() use ($conf) { |
|
| 62 | 62 | $confarray = array(); |
| 63 | 63 | $config_dev_file = __DIR__.'/../app/config/eccube/config_dev.yml'; |
| 64 | 64 | if (file_exists($config_dev_file)) { |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | apc_clear_cache(); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -require __DIR__ . '/../autoload.php'; |
|
| 29 | +require __DIR__.'/../autoload.php'; |
|
| 30 | 30 | |
| 31 | 31 | $app = new Eccube\InstallApplication(); |
| 32 | 32 | $app['debug'] = true; |
| 33 | -$app->before(function (\Symfony\Component\HttpFoundation\Request $request, \Silex\Application $app) { |
|
| 33 | +$app->before(function(\Symfony\Component\HttpFoundation\Request $request, \Silex\Application $app) { |
|
| 34 | 34 | if (!$request->getSession()->isStarted()) { |
| 35 | 35 | $request->getSession()->start(); |
| 36 | 36 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 57 | 57 | |
| 58 | - \Eccube\Util\Cache::clear($this->app,$input->getOption('all')); |
|
| 58 | + \Eccube\Util\Cache::clear($this->app, $input->getOption('all')); |
|
| 59 | 59 | $output->writeln(sprintf("%s <info>success</info>", 'cache:clear')); |
| 60 | 60 | |
| 61 | 61 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | protected function getBoundForm(Application $app, $type) |
| 39 | 39 | { |
| 40 | 40 | $form = $app['form.factory'] |
| 41 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
| 41 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
| 42 | 42 | ->getForm(); |
| 43 | 43 | $form->handleRequest($app['request']); |
| 44 | 44 | |
@@ -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); |