Completed
Pull Request — master (#1538)
by k-yamamura
86:12 queued 46:27
created
src/Eccube/Controller/Admin/Store/TemplateController.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
                     ->find($form['selected']->getData());
66 66
 
67 67
                 // path.ymlの再構築
68
-                $file = $app['config']['root_dir'] . '/app/config/eccube/path.yml';
68
+                $file = $app['config']['root_dir'].'/app/config/eccube/path.yml';
69 69
                 $config = Yaml::parse(file_get_contents($file));
70 70
 
71 71
                 $templateCode = $Template->getCode();
72 72
                 $config['template_code'] = $templateCode;
73
-                $config['template_realdir'] = $config['root_dir'] . '/app/template/' . $templateCode;
74
-                $config['template_html_realdir'] = $config['public_path_realdir'] . '/template/' . $templateCode;
75
-                $config['front_urlpath'] = $config['root_urlpath'] . '/template/' . $templateCode;
76
-                $config['block_realdir'] =$config['template_realdir'] . '/Block';
73
+                $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode;
74
+                $config['template_html_realdir'] = $config['public_path_realdir'].'/template/'.$templateCode;
75
+                $config['front_urlpath'] = $config['root_urlpath'].'/template/'.$templateCode;
76
+                $config['block_realdir'] = $config['template_realdir'].'/Block';
77 77
 
78 78
                 file_put_contents($file, Yaml::dump($config));
79 79
 
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
         // 該当テンプレートのディレクトリ
109 109
         $config = $app['config'];
110 110
         $templateCode = $Template->getCode();
111
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
112
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
111
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
112
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
113 113
 
114 114
         // 一時ディレクトリ
115 115
         $uniqId = sha1(Str::random(32));
116
-        $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
117
-        $appDir = $tmpDir . '/app';
118
-        $htmlDir = $tmpDir . '/html';
116
+        $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
117
+        $appDir = $tmpDir.'/app';
118
+        $htmlDir = $tmpDir.'/html';
119 119
 
120 120
         // ファイル名
121
-        $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar';
122
-        $tarGzFile = $tarFile . '.gz';
123
-        $downloadFileName = $Template->getCode() . '.tar.gz';
121
+        $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar';
122
+        $tarGzFile = $tarFile.'.gz';
123
+        $downloadFileName = $Template->getCode().'.tar.gz';
124 124
 
125 125
         // 該当テンプレートを一時ディレクトリへコピーする.
126 126
         $fs = new Filesystem();
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 
141 141
         // ダウンロード完了後にファイルを削除する.
142 142
         // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony
143
-        $app->finish(function (Request $request, Response $response, \Silex\Application $app) use (
143
+        $app->finish(function(Request $request, Response $response, \Silex\Application $app) use (
144 144
             $tmpDir,
145 145
             $tarFile,
146 146
             $tarGzFile
147 147
         ) {
148
-            $app['monolog']->addDebug('remove temp file: ' . $tmpDir);
149
-            $app['monolog']->addDebug('remove temp file: ' . $tarFile);
150
-            $app['monolog']->addDebug('remove temp file: ' . $tarGzFile);
148
+            $app['monolog']->addDebug('remove temp file: '.$tmpDir);
149
+            $app['monolog']->addDebug('remove temp file: '.$tarFile);
150
+            $app['monolog']->addDebug('remove temp file: '.$tarGzFile);
151 151
             $fs = new Filesystem();
152 152
             $fs->remove($tmpDir);
153 153
             $fs->remove($tarFile);
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
         // テンプレートディレクトリの削除
189 189
         $config = $app['config'];
190 190
         $templateCode = $Template->getCode();
191
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
192
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
191
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
192
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
193 193
 
194 194
         $fs = new Filesystem();
195 195
         $fs->remove($targetRealDir);
@@ -232,18 +232,18 @@  discard block
 block discarded – undo
232 232
                 // 該当テンプレートのディレクトリ
233 233
                 $config = $app['config'];
234 234
                 $templateCode = $Template->getCode();
235
-                $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
236
-                $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
235
+                $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
236
+                $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
237 237
 
238 238
                 // 一時ディレクトリ
239 239
                 $uniqId = sha1(Str::random(32));
240
-                $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
241
-                $appDir = $tmpDir . '/app';
242
-                $htmlDir = $tmpDir . '/html';
240
+                $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
241
+                $appDir = $tmpDir.'/app';
242
+                $htmlDir = $tmpDir.'/html';
243 243
 
244 244
                 $formFile = $form['file']->getData();
245 245
                 // ファイル名
246
-                $archive = $templateCode . '.' . $formFile->getClientOriginalExtension();
246
+                $archive = $templateCode.'.'.$formFile->getClientOriginalExtension();
247 247
 
248 248
                 // ファイルを一時ディレクトリへ移動.
249 249
                 $formFile->move($tmpDir, $archive);
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
                 try {
253 253
                     if ($formFile->getClientOriginalExtension() == 'zip') {
254 254
                         $zip = new \ZipArchive();
255
-                        $zip->open($tmpDir . '/' . $archive);
255
+                        $zip->open($tmpDir.'/'.$archive);
256 256
                         $zip->extractTo($tmpDir);
257 257
                         $zip->close();
258 258
                     } else {
259
-                        $phar = new \PharData($tmpDir . '/' . $archive);
259
+                        $phar = new \PharData($tmpDir.'/'.$archive);
260 260
                         $phar->extractTo($tmpDir, null, true);
261 261
                     }
262 262
                 } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/Eccube/Resource/doctrine/migration/Version20160413151321.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 
22 22
         // path.ymlの更新
23 23
         $app = Application::getInstance();
24
-        $file = $app['config']['root_dir'] . '/app/config/eccube/path.yml';
24
+        $file = $app['config']['root_dir'].'/app/config/eccube/path.yml';
25 25
         $config = Yaml::parse(file_get_contents($file));
26 26
 
27 27
         $config['public_path'] = '/html';
28
-        $config['public_path_realdir'] = $config['root_dir'] . $config['public_path'];
29
-        $config['plugin_html_realdir'] = $config['root_dir'] . $config['public_path'] . '/plugin';
30
-        $config['plugin_urlpath'] = $config['root_urlpath'] . '/plugin';
28
+        $config['public_path_realdir'] = $config['root_dir'].$config['public_path'];
29
+        $config['plugin_html_realdir'] = $config['root_dir'].$config['public_path'].'/plugin';
30
+        $config['plugin_urlpath'] = $config['root_urlpath'].'/plugin';
31 31
 
32 32
         file_put_contents($file, Yaml::dump($config));
33 33
 
Please login to merge, or discard this patch.