@@ -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) { |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use Eccube\Form\Type\Admin\TemplateType; |
| 30 | 30 | use Eccube\Util\Str; |
| 31 | 31 | use Symfony\Component\Filesystem\Filesystem; |
| 32 | -use Symfony\Component\Finder\Finder; |
|
| 33 | 32 | use Symfony\Component\Form\Extension\Core\Type\HiddenType; |
| 34 | 33 | use Symfony\Component\Form\FormError; |
| 35 | 34 | use Symfony\Component\HttpFoundation\Request; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | // ファイル生成・更新 |
| 115 | 115 | $tplDir = $app['config']['block_realdir']; |
| 116 | 116 | |
| 117 | - $filePath = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
| 117 | + $filePath = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
| 118 | 118 | |
| 119 | 119 | $fs = new Filesystem(); |
| 120 | 120 | $blockData = $form->get('block_html')->getData(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $fs->dumpFile($filePath, $blockData); |
| 123 | 123 | // 更新でファイル名を変更した場合、以前のファイルを削除 |
| 124 | 124 | if ($Block->getFileName() != $previous_filename && !is_null($previous_filename)) { |
| 125 | - $oldFilePath = $tplDir . '/' . $previous_filename . '.twig'; |
|
| 125 | + $oldFilePath = $tplDir.'/'.$previous_filename.'.twig'; |
|
| 126 | 126 | if ($fs->exists($oldFilePath)) { |
| 127 | 127 | $fs->remove($oldFilePath); |
| 128 | 128 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | // テンプレートが変更されていた場合、DBからはブロック削除されるがtwigファイルは残る |
| 176 | 176 | if ($Block->getDeletableFlg() > 0) { |
| 177 | 177 | $tplDir = $app['config']['block_realdir']; |
| 178 | - $file = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
| 178 | + $file = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
| 179 | 179 | $fs = new Filesystem(); |
| 180 | 180 | if ($fs->exists($file)) { |
| 181 | 181 | $fs->remove($file); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する |
| 84 | 84 | if (!in_array($parentPage, $allowdParents)) { |
| 85 | 85 | // @deprecated 使用されていないコード |
| 86 | - $parentPage = $app->url('mypage_delivery'); |
|
| 86 | + $parentPage = $app->url('mypage_delivery'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $builder = $app['form.factory'] |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $paths[] = $app['config']['user_data_realdir']; |
| 56 | 56 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
| 57 | 57 | |
| 58 | - $file = $PageLayout->getFileName() . '.twig'; |
|
| 58 | + $file = $PageLayout->getFileName().'.twig'; |
|
| 59 | 59 | |
| 60 | 60 | $event = new EventArgs( |
| 61 | 61 | array( |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // リセットキーの発行・有効期限の設定 |
| 65 | 65 | $Customer |
| 66 | 66 | ->setResetKey($app['eccube.repository.customer']->getUniqueResetKey($app)) |
| 67 | - ->setResetExpire(new \DateTime('+' . $app['config']['customer_reset_expire'] .' min')); |
|
| 67 | + ->setResetExpire(new \DateTime('+'.$app['config']['customer_reset_expire'].' min')); |
|
| 68 | 68 | |
| 69 | 69 | // リセットキーを更新 |
| 70 | 70 | $app['orm.em']->persist($Customer); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | // ログ出力 |
| 89 | 89 | $app['monolog']->addInfo( |
| 90 | - 'send reset password mail to:' . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
| 90 | + 'send reset password mail to:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
| 91 | 91 | ); |
| 92 | 92 | } else { |
| 93 | 93 | log_warning('Un active customer try send reset password email: ', array('Enter email' => $form->get('login_email')->getData())); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | // ログ出力 |
| 171 | 171 | $app['monolog']->addInfo( |
| 172 | - 'reset password complete:' . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
| 172 | + 'reset password complete:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
| 173 | 173 | ); |
| 174 | 174 | } else { |
| 175 | 175 | throw new HttpException\AccessDeniedHttpException('不正なアクセスです。'); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $key = sprintf('keyword%s', $index); |
| 114 | 114 | $qb |
| 115 | 115 | ->andWhere(sprintf('NORMALIZE(p.name) LIKE NORMALIZE(:%s) OR NORMALIZE(p.search_word) LIKE NORMALIZE(:%s)', $key, $key)) |
| 116 | - ->setParameter($key, '%' . $keyword . '%'); |
|
| 116 | + ->setParameter($key, '%'.$keyword.'%'); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $qb |
| 177 | 177 | ->andWhere('p.id = :id OR p.name LIKE :likeid OR pc.code LIKE :likeid') |
| 178 | 178 | ->setParameter('id', $id) |
| 179 | - ->setParameter('likeid', '%' . $searchData['id'] . '%'); |
|
| 179 | + ->setParameter('likeid', '%'.$searchData['id'].'%'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | // code |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * @param array $metadatas |
| 349 | 349 | * @param array $fsList |
| 350 | 350 | * @param $pluginCode |
| 351 | - * @param $codePath |
|
| 351 | + * @param string $codePath |
|
| 352 | 352 | */ |
| 353 | 353 | protected function generateMigration(array $metadatas, array &$fsList = array(), $pluginCode, $codePath) |
| 354 | 354 | { |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | * |
| 374 | 374 | * @param $pluginCode |
| 375 | 375 | * @param array $metadatas |
| 376 | - * @return mixed|string |
|
| 376 | + * @return string |
|
| 377 | 377 | */ |
| 378 | 378 | protected function makeMigration($pluginCode, array $metadatas) |
| 379 | 379 | { |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | use Symfony\Component\Console\Input\InputOption; |
| 34 | 34 | use Symfony\Component\Console\Output\OutputInterface; |
| 35 | 35 | use Symfony\Component\Console\Question\Question; |
| 36 | -use Symfony\Component\Validator\Constraints as Assert; |
|
| 37 | 36 | |
| 38 | 37 | class PluginCommand extends \Knp\Command\Command |
| 39 | 38 | { |
@@ -2,15 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Eccube\Application; |
| 4 | 4 | |
| 5 | -use Eccube\Event\TemplateEvent; |
|
| 6 | -use Monolog\Logger; |
|
| 7 | -use Symfony\Component\Form\FormBuilder; |
|
| 8 | 5 | use Symfony\Component\HttpFoundation\Request; |
| 9 | 6 | use Symfony\Component\HttpFoundation\Response; |
| 10 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
| 11 | 7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
| 12 | -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
|
| 13 | -use Symfony\Component\Security\Core\User\UserInterface; |
|
| 14 | 8 | |
| 15 | 9 | trait ApplicationTrait |
| 16 | 10 | { |
@@ -16,6 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | 18 | * Application Shortcut Methods |
| 19 | + * @param string $message |
|
| 19 | 20 | */ |
| 20 | 21 | public function addSuccess($message, $namespace = 'front') |
| 21 | 22 | { |
@@ -32,6 +33,9 @@ discard block |
||
| 32 | 33 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
| 33 | 34 | } |
| 34 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $message |
|
| 38 | + */ |
|
| 35 | 39 | public function addWarning($message, $namespace = 'front') |
| 36 | 40 | { |
| 37 | 41 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
@@ -42,6 +46,9 @@ discard block |
||
| 42 | 46 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
| 43 | 47 | } |
| 44 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $message |
|
| 51 | + */ |
|
| 45 | 52 | public function addRequestError($message, $namespace = 'front') |
| 46 | 53 | { |
| 47 | 54 | $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
@@ -58,6 +65,9 @@ discard block |
||
| 58 | 65 | $this->addWarning('admin.delete.warning', 'admin'); |
| 59 | 66 | } |
| 60 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $targetPath |
|
| 70 | + */ |
|
| 61 | 71 | public function setLoginTargetPath($targetPath, $namespace = null) |
| 62 | 72 | { |
| 63 | 73 | if (is_null($namespace)) { |
@@ -109,7 +119,7 @@ discard block |
||
| 109 | 119 | * @param string $path フォワード先のパス |
| 110 | 120 | * @param array $requestParameters |
| 111 | 121 | * @param Response $response |
| 112 | - * @return Application |
|
| 122 | + * @return ApplicationTrait |
|
| 113 | 123 | */ |
| 114 | 124 | public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
| 115 | 125 | { |
@@ -19,32 +19,32 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function addSuccess($message, $namespace = 'front') |
| 21 | 21 | { |
| 22 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.success', $message); |
|
| 22 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.success', $message); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function addError($message, $namespace = 'front') |
| 26 | 26 | { |
| 27 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.error', $message); |
|
| 27 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.error', $message); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function addDanger($message, $namespace = 'front') |
| 31 | 31 | { |
| 32 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
|
| 32 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.danger', $message); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function addWarning($message, $namespace = 'front') |
| 36 | 36 | { |
| 37 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
|
| 37 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.warning', $message); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function addInfo($message, $namespace = 'front') |
| 41 | 41 | { |
| 42 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
|
| 42 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.info', $message); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function addRequestError($message, $namespace = 'front') |
| 46 | 46 | { |
| 47 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
|
| 47 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.request.error', $message); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function clearMessage() |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if (is_null($namespace)) { |
| 64 | 64 | $this['session']->getFlashBag()->set('eccube.login.target.path', $targetPath); |
| 65 | 65 | } else { |
| 66 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.login.target.path', $targetPath); |
|
| 66 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param Response $response |
| 112 | 112 | * @return Application |
| 113 | 113 | */ |
| 114 | - public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
|
| 114 | + public function forwardChain($path, array $requestParameters = [], Response&$response = null) |
|
| 115 | 115 | { |
| 116 | 116 | $response = $this->forward($path, $requestParameters); |
| 117 | 117 | return $this; |