@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function __construct($type = 'js') |
54 | 54 | { |
55 | 55 | $this->type = $type; |
56 | - $this->path = WEB_DIR . DIRECTORY_SEPARATOR; |
|
56 | + $this->path = WEB_DIR.DIRECTORY_SEPARATOR; |
|
57 | 57 | $this->domains = Template::getDomains(true); |
58 | 58 | $this->cdnPath = Config::getParam('resources.cdn.url', Request::getInstance()->getRootUrl()); |
59 | 59 | } |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function addFile($filename) |
68 | 68 | { |
69 | - if (file_exists($this->path . $filename) && preg_match('/\.' . $this->type . '$/i', $filename)) { |
|
69 | + if (file_exists($this->path.$filename) && preg_match('/\.'.$this->type.'$/i', $filename)) { |
|
70 | 70 | $this->files[] = $filename; |
71 | 71 | } elseif (!empty($this->domains)) { |
72 | 72 | foreach ($this->domains as $domain => $paths) { |
73 | 73 | $domainFilename = str_replace($domain, $paths["public"], $filename); |
74 | - if (file_exists($domainFilename) && preg_match('/\.' . $this->type . '$/i', $domainFilename)) { |
|
74 | + if (file_exists($domainFilename) && preg_match('/\.'.$this->type.'$/i', $domainFilename)) { |
|
75 | 75 | $this->files[] = $domainFilename; |
76 | 76 | } |
77 | 77 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function setHash($hash) |
89 | 89 | { |
90 | 90 | $cache = Config::getParam('cache.var', ''); |
91 | - $this->hash = $hash . (strlen($cache) ? '.' : '') . $cache; |
|
91 | + $this->hash = $hash.(strlen($cache) ? '.' : '').$cache; |
|
92 | 92 | return $this; |
93 | 93 | } |
94 | 94 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $sourceFile = explode("?", $sourceFile); |
151 | 151 | $sourceFile = $sourceFile[0]; |
152 | 152 | } |
153 | - $orig = realpath(dirname($filenamePath) . DIRECTORY_SEPARATOR . $sourceFile); |
|
153 | + $orig = realpath(dirname($filenamePath).DIRECTORY_SEPARATOR.$sourceFile); |
|
154 | 154 | return $orig; |
155 | 155 | } |
156 | 156 | |
@@ -167,15 +167,15 @@ discard block |
||
167 | 167 | if (preg_match_all('#url\((.*?)\)#', $line, $urls, PREG_SET_ORDER)) { |
168 | 168 | foreach ($urls as $source) { |
169 | 169 | $orig = self::calculateResourcePathname($filenamePath, $source); |
170 | - if(!empty($orig)) { |
|
170 | + if (!empty($orig)) { |
|
171 | 171 | $orig_part = preg_split("/Public/i", $orig); |
172 | - $dest = WEB_DIR . $orig_part[1]; |
|
172 | + $dest = WEB_DIR.$orig_part[1]; |
|
173 | 173 | GeneratorHelper::createDir(dirname($dest)); |
174 | 174 | if (@copy($orig, $dest) === false) { |
175 | - throw new ConfigException("Can't copy " . $orig . " to " . $dest); |
|
175 | + throw new ConfigException("Can't copy ".$orig." to ".$dest); |
|
176 | 176 | } |
177 | - } else { |
|
178 | - Logger::log($filenamePath . ' has an empty origin with the url ' . $source, LOG_WARNING); |
|
177 | + }else { |
|
178 | + Logger::log($filenamePath.' has an empty origin with the url '.$source, LOG_WARNING); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | |
44 | 44 | $filePath = ''; |
45 | 45 | if (!file_exists($filePath)) { |
46 | - $filePath = BASE_DIR . $string; |
|
46 | + $filePath = BASE_DIR.$string; |
|
47 | 47 | } |
48 | 48 | $filenamePath = AssetsHelper::findDomainPath($string, $filePath); |
49 | 49 | |
50 | 50 | $filePath = self::processAsset($string, $name, $return, $filenamePath); |
51 | 51 | $basePath = Config::getParam('resources.cdn.url', Request::getInstance()->getRootUrl()); |
52 | - $returnPath = empty($name) ? $basePath . '/' . $filePath : $name; |
|
52 | + $returnPath = empty($name) ? $basePath.'/'.$filePath : $name; |
|
53 | 53 | return $return ? $returnPath : ''; |
54 | 54 | } |
55 | 55 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $router = Router::getInstance(); |
67 | 67 | try { |
68 | 68 | return $router->getRoute($path, $absolute, $params); |
69 | - } catch (\Exception $e) { |
|
69 | + }catch (\Exception $e) { |
|
70 | 70 | return $router->getRoute('', $absolute, $params); |
71 | 71 | } |
72 | 72 | } |
@@ -213,9 +213,9 @@ discard block |
||
213 | 213 | { |
214 | 214 | $data = file_get_contents($filenamePath); |
215 | 215 | if (!empty($name)) { |
216 | - file_put_contents(WEB_DIR . DIRECTORY_SEPARATOR . $name, $data); |
|
217 | - } else { |
|
218 | - file_put_contents($base . $filePath, $data); |
|
216 | + file_put_contents(WEB_DIR.DIRECTORY_SEPARATOR.$name, $data); |
|
217 | + }else { |
|
218 | + file_put_contents($base.$filePath, $data); |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | if (file_exists($filenamePath)) { |
235 | 235 | list($base, $htmlBase, $filePath) = AssetsHelper::calculateAssetPath($string, $name, $return, $filenamePath); |
236 | 236 | //Creamos el directorio si no existe |
237 | - GeneratorHelper::createDir($base . $htmlBase); |
|
237 | + GeneratorHelper::createDir($base.$htmlBase); |
|
238 | 238 | //Si se ha modificado |
239 | - if (!file_exists($base . $filePath) || filemtime($base . $filePath) < filemtime($filenamePath)) { |
|
239 | + if (!file_exists($base.$filePath) || filemtime($base.$filePath) < filemtime($filenamePath)) { |
|
240 | 240 | if ($htmlBase === 'css') { |
241 | 241 | self::processCssLines($filenamePath); |
242 | 242 | } |