@@ -102,7 +102,7 @@ |
||
102 | 102 | if (count($allowHost) > 0) { |
103 | 103 | $form->get('admin_allow_host')->setData(Str::convertLineFeed(implode("\n", $allowHost))); |
104 | 104 | } |
105 | - $form->get('force_ssl')->setData((bool)$app['config']['force_ssl']); |
|
105 | + $form->get('force_ssl')->setData((bool) $app['config']['force_ssl']); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return $app->render('Setting/System/security.twig', array( |
@@ -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) { |