@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $this->appData = $appData; |
73 | 73 | $this->urlGenerator = $urlGenerator; |
74 | 74 | $this->cacheFactory = $cacheFactory; |
75 | - $this->depsCache = $this->cacheFactory->createDistributed('JS-' . md5($this->urlGenerator->getBaseUrl())); |
|
75 | + $this->depsCache = $this->cacheFactory->createDistributed('JS-'.md5($this->urlGenerator->getBaseUrl())); |
|
76 | 76 | $this->config = $config; |
77 | 77 | $this->logger = $logger; |
78 | 78 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return false; |
89 | 89 | } |
90 | 90 | |
91 | - $path = explode('/', $root . '/' . $file); |
|
91 | + $path = explode('/', $root.'/'.$file); |
|
92 | 92 | |
93 | 93 | $fileName = array_pop($path); |
94 | 94 | $path = implode('/', $path); |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | return false; |
119 | 119 | } |
120 | 120 | |
121 | - $fileName = $fileName . '.deps'; |
|
121 | + $fileName = $fileName.'.deps'; |
|
122 | 122 | try { |
123 | - $deps = $this->depsCache->get($folder->getName() . '-' . $fileName); |
|
123 | + $deps = $this->depsCache->get($folder->getName().'-'.$fileName); |
|
124 | 124 | $fromCache = true; |
125 | 125 | if ($deps === null || $deps === '') { |
126 | 126 | $fromCache = false; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // check again |
132 | 132 | if ($deps === null || $deps === '') { |
133 | - $this->logger->info('JSCombiner: deps file empty: ' . $fileName); |
|
133 | + $this->logger->info('JSCombiner: deps file empty: '.$fileName); |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($fromCache === false) { |
150 | - $this->depsCache->set($folder->getName() . '-' . $fileName, json_encode($deps)); |
|
150 | + $this->depsCache->set($folder->getName().'-'.$fileName, json_encode($deps)); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return true; |
@@ -164,17 +164,17 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function cache($path, $fileName, ISimpleFolder $folder) { |
166 | 166 | $deps = []; |
167 | - $fullPath = $path . '/' . $fileName; |
|
167 | + $fullPath = $path.'/'.$fileName; |
|
168 | 168 | $data = json_decode(file_get_contents($fullPath)); |
169 | 169 | $deps[$fullPath] = filemtime($fullPath); |
170 | 170 | |
171 | 171 | $res = ''; |
172 | 172 | foreach ($data as $file) { |
173 | - $filePath = $path . '/' . $file; |
|
173 | + $filePath = $path.'/'.$file; |
|
174 | 174 | |
175 | 175 | if (is_file($filePath)) { |
176 | 176 | $res .= file_get_contents($filePath); |
177 | - $res .= PHP_EOL . PHP_EOL; |
|
177 | + $res .= PHP_EOL.PHP_EOL; |
|
178 | 178 | $deps[$filePath] = filemtime($filePath); |
179 | 179 | } |
180 | 180 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $cachedfile = $folder->newFile($fileName); |
187 | 187 | } |
188 | 188 | |
189 | - $depFileName = $fileName . '.deps'; |
|
189 | + $depFileName = $fileName.'.deps'; |
|
190 | 190 | try { |
191 | 191 | $depFile = $folder->getFile($depFileName); |
192 | 192 | } catch (NotFoundException $e) { |
@@ -194,21 +194,21 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | try { |
197 | - $gzipFile = $folder->getFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
197 | + $gzipFile = $folder->getFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
198 | 198 | } catch (NotFoundException $e) { |
199 | - $gzipFile = $folder->newFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
199 | + $gzipFile = $folder->newFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | try { |
203 | 203 | $cachedfile->putContent($res); |
204 | 204 | $deps = json_encode($deps); |
205 | 205 | $depFile->putContent($deps); |
206 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
206 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
207 | 207 | $gzipFile->putContent(gzencode($res, 9)); |
208 | - $this->logger->debug('JSCombiner: successfully cached: ' . $fileName); |
|
208 | + $this->logger->debug('JSCombiner: successfully cached: '.$fileName); |
|
209 | 209 | return true; |
210 | 210 | } catch (NotPermittedException $e) { |
211 | - $this->logger->error('JSCombiner: unable to cache: ' . $fileName); |
|
211 | + $this->logger->error('JSCombiner: unable to cache: '.$fileName); |
|
212 | 212 | return false; |
213 | 213 | } |
214 | 214 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function getContent($root, $file) { |
235 | 235 | /** @var array $data */ |
236 | - $data = json_decode(file_get_contents($root . '/' . $file)); |
|
236 | + $data = json_decode(file_get_contents($root.'/'.$file)); |
|
237 | 237 | if (!is_array($data)) { |
238 | 238 | return []; |
239 | 239 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | $result = []; |
246 | 246 | foreach ($data as $f) { |
247 | - $result[] = $path . '/' . $f; |
|
247 | + $result[] = $path.'/'.$f; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | return $result; |