@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $dump = ''; |
112 | 112 | try { |
113 | 113 | $dump = $this->tpl->render($tpl, $vars); |
114 | - } catch (\Exception $e) { |
|
114 | + }catch (\Exception $e) { |
|
115 | 115 | Logger::log($e->getMessage(), LOG_ERR); |
116 | 116 | } |
117 | 117 | return $dump; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function regenerateTemplates() |
139 | 139 | { |
140 | 140 | $this->generateTemplatesCache(); |
141 | - $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . "domains.json", Cache::JSON, true); |
|
141 | + $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR."domains.json", Cache::JSON, true); |
|
142 | 142 | $translations = []; |
143 | 143 | if (is_array($domains)) { |
144 | 144 | $translations = $this->parsePathTranslations($domains); |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | // force compilation |
161 | 161 | if ($file->isFile()) { |
162 | 162 | try { |
163 | - $this->tpl->load(str_replace($tplDir . '/', '', $file)); |
|
164 | - } catch (\Exception $e) { |
|
163 | + $this->tpl->load(str_replace($tplDir.'/', '', $file)); |
|
164 | + }catch (\Exception $e) { |
|
165 | 165 | Logger::log($e->getMessage(), LOG_ERR, ['file' => $e->getFile(), 'line' => $e->getLine()]); |
166 | 166 | } |
167 | 167 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | 'existsFlash' => TemplateFunctions::EXISTS_FLASH_FUNCTION, |
222 | 222 | 'getFlash' => TemplateFunctions::GET_FLASH_FUNCTION, |
223 | 223 | ]; |
224 | - foreach($functions as $name => $function) { |
|
224 | + foreach ($functions as $name => $function) { |
|
225 | 225 | $this->addTemplateFunction($name, $function); |
226 | 226 | } |
227 | 227 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | private function loadDomains() |
242 | 242 | { |
243 | - $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', Cache::JSON, true); |
|
243 | + $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', Cache::JSON, true); |
|
244 | 244 | if (null !== $domains) { |
245 | 245 | foreach ($domains as $domain => $paths) { |
246 | 246 | $this->addPath($paths['template'], preg_replace('/(@|\/)/', '', $domain)); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | { |
256 | 256 | $loader = new \Twig_Loader_Filesystem(GeneratorHelper::getTemplatePath()); |
257 | 257 | $this->tpl = new \Twig_Environment($loader, array( |
258 | - 'cache' => CACHE_DIR . DIRECTORY_SEPARATOR . 'twig', |
|
258 | + 'cache' => CACHE_DIR.DIRECTORY_SEPARATOR.'twig', |
|
259 | 259 | 'debug' => (bool)$this->debug, |
260 | 260 | 'auto_reload' => Config::getParam('twig.autoreload', TRUE), |
261 | 261 | )); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } elseif ($mappedColumn->isText()) { |
42 | 42 | if ($mappedColumn->getSize() > 100) { |
43 | 43 | $fDto = self::createField($field, Field::TEXTAREA_TYPE, $required); |
44 | - } else { |
|
44 | + }else { |
|
45 | 45 | $fDto = self::generateStringField($field, $required); |
46 | 46 | } |
47 | 47 | } elseif ($mappedColumn->getType() === PropelTypes::BOOLEAN) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $fDto->entity = $relatedModel; |
86 | 86 | $relatedField = $foreignTable->getColumn($mappedColumn->getRelatedColumnName()); |
87 | 87 | $fDto->relatedField = $relatedField->getPhpName(); |
88 | - $fDto->url = Router::getInstance()->getRoute(strtolower($domain) . '-api-' . $relatedModel); |
|
88 | + $fDto->url = Router::getInstance()->getRoute(strtolower($domain).'-api-'.$relatedModel); |
|
89 | 89 | return $fDto; |
90 | 90 | } |
91 | 91 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | try { |
194 | 194 | $column = $tableMap->getColumnByPhpName($field); |
195 | - } catch (\Exception $e) { |
|
195 | + }catch (\Exception $e) { |
|
196 | 196 | Logger::log($e->getMessage(), LOG_ERR); |
197 | 197 | $column = null; |
198 | 198 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @param ModelCriteria $query |
205 | 205 | * @param mixed $value |
206 | 206 | */ |
207 | - private static function addQueryFilter(ColumnMap $column, ModelCriteria &$query, $value = null) |
|
207 | + private static function addQueryFilter(ColumnMap $column, ModelCriteria & $query, $value = null) |
|
208 | 208 | { |
209 | 209 | $tableField = $column->getPhpName(); |
210 | 210 | if (preg_match('/^<=/', $value)) { |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) { |
219 | 219 | $text = preg_replace('/(\'|\")/', '', $value); |
220 | 220 | $text = preg_replace('/\ /', '%', $text); |
221 | - $query->filterBy($tableField, '%' . $text . '%', Criteria::LIKE); |
|
222 | - } else { |
|
221 | + $query->filterBy($tableField, '%'.$text.'%', Criteria::LIKE); |
|
222 | + }else { |
|
223 | 223 | $query->filterBy($tableField, $value, Criteria::EQUAL); |
224 | 224 | } |
225 | 225 | } |
@@ -230,24 +230,24 @@ discard block |
||
230 | 230 | * @param array $extraColumns |
231 | 231 | * @param mixed $value |
232 | 232 | */ |
233 | - public static function composerComboField(TableMap $tableMap, ModelCriteria &$query, array $extraColumns = [], $value = null) |
|
233 | + public static function composerComboField(TableMap $tableMap, ModelCriteria & $query, array $extraColumns = [], $value = null) |
|
234 | 234 | { |
235 | 235 | $exp = 'CONCAT('; |
236 | 236 | $sep = ''; |
237 | 237 | foreach ($tableMap->getColumns() as $column) { |
238 | 238 | if ($column->isText()) { |
239 | - $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")'; |
|
239 | + $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")'; |
|
240 | 240 | $sep = ', " ", '; |
241 | 241 | } |
242 | 242 | } |
243 | 243 | foreach ($extraColumns as $extra => $name) { |
244 | - $exp .= $sep . $extra; |
|
244 | + $exp .= $sep.$extra; |
|
245 | 245 | $sep = ', " ", '; |
246 | 246 | } |
247 | 247 | $exp .= ")"; |
248 | 248 | $text = preg_replace('/(\'|\")/', '', $value); |
249 | 249 | $text = preg_replace('/\ /', '%', $text); |
250 | - $query->where($exp . Criteria::LIKE . '"%' . $text . '%"'); |
|
250 | + $query->where($exp.Criteria::LIKE.'"%'.$text.'%"'); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @param string $field |
258 | 258 | * @param mixed $value |
259 | 259 | */ |
260 | - public static function addModelField(TableMap $tableMap, ModelCriteria &$query, $field, $value = null) |
|
260 | + public static function addModelField(TableMap $tableMap, ModelCriteria & $query, $field, $value = null) |
|
261 | 261 | { |
262 | 262 | if ($column = self::checkFieldExists($tableMap, $field)) { |
263 | 263 | self::addQueryFilter($column, $query, $value); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct($type = 'js') |
33 | 33 | { |
34 | 34 | $this->type = $type; |
35 | - $this->path = WEB_DIR . DIRECTORY_SEPARATOR; |
|
35 | + $this->path = WEB_DIR.DIRECTORY_SEPARATOR; |
|
36 | 36 | $this->domains = Template::getDomains(true); |
37 | 37 | $this->debug = Config::getInstance()->getDebugMode(); |
38 | 38 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $source_file = explode("?", $source_file); |
55 | 55 | $source_file = $source_file[0]; |
56 | 56 | } |
57 | - $orig = realpath(dirname($filename_path) . DIRECTORY_SEPARATOR . $source_file); |
|
57 | + $orig = realpath(dirname($filename_path).DIRECTORY_SEPARATOR.$source_file); |
|
58 | 58 | return $orig; |
59 | 59 | } |
60 | 60 | |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function addFile($filename) |
69 | 69 | { |
70 | - if (file_exists($this->path . $filename) && preg_match('/\.' . $this->type . '$/i', $filename)) { |
|
70 | + if (file_exists($this->path.$filename) && preg_match('/\.'.$this->type.'$/i', $filename)) { |
|
71 | 71 | $this->files[] = $filename; |
72 | 72 | } elseif (!empty($this->domains)) { |
73 | 73 | foreach ($this->domains as $domain => $paths) { |
74 | 74 | $domain_filename = str_replace($domain, $paths["public"], $filename); |
75 | - if (file_exists($domain_filename) && preg_match('/\.' . $this->type . '$/i', $domain_filename)) { |
|
75 | + if (file_exists($domain_filename) && preg_match('/\.'.$this->type.'$/i', $domain_filename)) { |
|
76 | 76 | $this->files[] = $domain_filename; |
77 | 77 | } |
78 | 78 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function setHash($hash) |
90 | 90 | { |
91 | 91 | $cache = Config::getParam('cache.var', ''); |
92 | - $this->hash = $hash . (strlen($cache) ? '.' : '') . $cache; |
|
92 | + $this->hash = $hash.(strlen($cache) ? '.' : '').$cache; |
|
93 | 93 | return $this; |
94 | 94 | } |
95 | 95 | |
@@ -123,15 +123,15 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function compileCss() |
125 | 125 | { |
126 | - $base = $this->path . "css" . DIRECTORY_SEPARATOR; |
|
127 | - if ($this->debug || !file_exists($base . $this->hash . ".css")) { |
|
126 | + $base = $this->path."css".DIRECTORY_SEPARATOR; |
|
127 | + if ($this->debug || !file_exists($base.$this->hash.".css")) { |
|
128 | 128 | $data = ''; |
129 | 129 | if (0 < count($this->files)) { |
130 | 130 | foreach ($this->files as $file) { |
131 | 131 | $data = $this->processCssLine($file, $base, $data); |
132 | 132 | } |
133 | 133 | } |
134 | - $this->storeContents($base . $this->hash . ".css", \CssMin::minify($data)); |
|
134 | + $this->storeContents($base.$this->hash.".css", \CssMin::minify($data)); |
|
135 | 135 | unset($cssMinifier); |
136 | 136 | } |
137 | 137 | return $this; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | */ |
145 | 145 | protected function compileJs() |
146 | 146 | { |
147 | - $base = $this->path . "js" . DIRECTORY_SEPARATOR; |
|
148 | - if ($this->debug || !file_exists($base . $this->hash . ".js")) { |
|
147 | + $base = $this->path."js".DIRECTORY_SEPARATOR; |
|
148 | + if ($this->debug || !file_exists($base.$this->hash.".js")) { |
|
149 | 149 | $data = ''; |
150 | 150 | if (0 < count($this->files)) { |
151 | 151 | foreach ($this->files as $file) { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if (file_exists($file)) { |
154 | 154 | if ($this->debug) { |
155 | 155 | $data = $this->putDebugJs($path_parts, $base, $file); |
156 | - } elseif (!file_exists($base . $this->hash . ".js")) { |
|
156 | + } elseif (!file_exists($base.$this->hash.".js")) { |
|
157 | 157 | $data = $this->putProductionJs($base, $file, $data); |
158 | 158 | } |
159 | 159 | } |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | } |
162 | 162 | try { |
163 | 163 | $minifiedJs = Minifier::minify($data); |
164 | - } catch (\Exception $e) { |
|
164 | + }catch (\Exception $e) { |
|
165 | 165 | Logger::log($e->getMessage(), LOG_ERR); |
166 | 166 | $minifiedJs = false; |
167 | 167 | } |
168 | - $this->storeContents($base . $this->hash . ".js", (false !== $minifiedJs) ? $minifiedJs : $data); |
|
168 | + $this->storeContents($base.$this->hash.".js", (false !== $minifiedJs) ? $minifiedJs : $data); |
|
169 | 169 | } |
170 | 170 | return $this; |
171 | 171 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | { |
181 | 181 | GeneratorHelper::createDir(dirname($path)); |
182 | 182 | if ("" !== $content && false === file_put_contents($path, $content)) { |
183 | - throw new ConfigException(_('No se tienen permisos para escribir en ' . $path)); |
|
183 | + throw new ConfigException(_('No se tienen permisos para escribir en '.$path)); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | foreach ($this->compiled_files as $file) { |
210 | 210 | echo "\t\t<script type='text/javascript' src='{$file}'></script>\n"; |
211 | 211 | } |
212 | - } else { |
|
213 | - echo "\t\t<script type='text/javascript' src='/js/" . $this->hash . ".js'></script>\n"; |
|
212 | + }else { |
|
213 | + echo "\t\t<script type='text/javascript' src='/js/".$this->hash.".js'></script>\n"; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | foreach ($this->compiled_files as $file) { |
224 | 224 | echo "\t\t<link href='{$file}' rel='stylesheet' media='screen, print'>"; |
225 | 225 | } |
226 | - } else { |
|
227 | - echo "\t\t<link href='/css/" . $this->hash . ".css' rel='stylesheet'>"; |
|
226 | + }else { |
|
227 | + echo "\t\t<link href='/css/".$this->hash.".css' rel='stylesheet'>"; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -235,20 +235,20 @@ discard block |
||
235 | 235 | protected function extractCssResources($source, $file) |
236 | 236 | { |
237 | 237 | $source_file = $this->extractSourceFilename($source); |
238 | - $orig = realpath(dirname($file) . DIRECTORY_SEPARATOR . $source_file); |
|
238 | + $orig = realpath(dirname($file).DIRECTORY_SEPARATOR.$source_file); |
|
239 | 239 | $orig_part = preg_split('/(\/|\\\)public(\/|\\\)/i', $orig); |
240 | 240 | try { |
241 | 241 | if (count($source) > 1 && array_key_exists(1, $orig_part)) { |
242 | - $dest = $this->path . $orig_part[1]; |
|
242 | + $dest = $this->path.$orig_part[1]; |
|
243 | 243 | GeneratorHelper::createDir(dirname($dest)); |
244 | 244 | if (!file_exists($dest) || filemtime($orig) > filemtime($dest)) { |
245 | 245 | if (@copy($orig, $dest) === FALSE) { |
246 | - throw new \RuntimeException('Can\' copy ' . $dest . ''); |
|
246 | + throw new \RuntimeException('Can\' copy '.$dest.''); |
|
247 | 247 | } |
248 | 248 | Logger::log("$orig copiado a $dest", LOG_INFO); |
249 | 249 | } |
250 | 250 | } |
251 | - } catch (\Exception $e) { |
|
251 | + }catch (\Exception $e) { |
|
252 | 252 | Logger::log($e->getMessage(), LOG_ERR); |
253 | 253 | } |
254 | 254 | } |
@@ -265,21 +265,21 @@ discard block |
||
265 | 265 | { |
266 | 266 | if (file_exists($file)) { |
267 | 267 | $path_parts = explode("/", $file); |
268 | - $file_path = $this->hash . "_" . $path_parts[count($path_parts) - 1]; |
|
269 | - if (!file_exists($base . $file_path) || filemtime($base . $file_path) < filemtime($file) || $this->debug) { |
|
268 | + $file_path = $this->hash."_".$path_parts[count($path_parts) - 1]; |
|
269 | + if (!file_exists($base.$file_path) || filemtime($base.$file_path) < filemtime($file) || $this->debug) { |
|
270 | 270 | //Si tenemos modificaciones tenemos que compilar de nuevo todos los ficheros modificados |
271 | - if (file_exists($base . $this->hash . ".css") && @unlink($base . $this->hash . ".css") === false) { |
|
272 | - throw new ConfigException("Can't unlink file " . $base . $this->hash . ".css"); |
|
271 | + if (file_exists($base.$this->hash.".css") && @unlink($base.$this->hash.".css") === false) { |
|
272 | + throw new ConfigException("Can't unlink file ".$base.$this->hash.".css"); |
|
273 | 273 | } |
274 | 274 | $this->loopCssLines($file); |
275 | 275 | } |
276 | 276 | if ($this->debug) { |
277 | 277 | $data = file_get_contents($file); |
278 | - $this->storeContents($base . $file_path, $data); |
|
279 | - } else { |
|
278 | + $this->storeContents($base.$file_path, $data); |
|
279 | + }else { |
|
280 | 280 | $data .= file_get_contents($file); |
281 | 281 | } |
282 | - $this->compiled_files[] = "/css/" . $file_path; |
|
282 | + $this->compiled_files[] = "/css/".$file_path; |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | return $data; |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | */ |
295 | 295 | protected function putDebugJs($path_parts, $base, $file) |
296 | 296 | { |
297 | - $file_path = $this->hash . "_" . $path_parts[count($path_parts) - 1]; |
|
298 | - $this->compiled_files[] = "/js/" . $file_path; |
|
297 | + $file_path = $this->hash."_".$path_parts[count($path_parts) - 1]; |
|
298 | + $this->compiled_files[] = "/js/".$file_path; |
|
299 | 299 | $data = ""; |
300 | - if (!file_exists($base . $file_path) || filemtime($base . $file_path) < filemtime($file)) { |
|
300 | + if (!file_exists($base.$file_path) || filemtime($base.$file_path) < filemtime($file)) { |
|
301 | 301 | $data = file_get_contents($file); |
302 | - $this->storeContents($base . $file_path, $data); |
|
302 | + $this->storeContents($base.$file_path, $data); |
|
303 | 303 | } |
304 | 304 | return $data; |
305 | 305 | } |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | { |
317 | 317 | $js = file_get_contents($file); |
318 | 318 | try { |
319 | - $data .= ";\n" . $js; |
|
320 | - } catch (\Exception $e) { |
|
319 | + $data .= ";\n".$js; |
|
320 | + }catch (\Exception $e) { |
|
321 | 321 | throw new ConfigException($e->getMessage()); |
322 | 322 | } |
323 | 323 | return $data; |
@@ -360,60 +360,60 @@ discard block |
||
360 | 360 | { |
361 | 361 | $ppath = explode("/", $string); |
362 | 362 | $original_filename = $ppath[count($ppath) - 1]; |
363 | - $base = WEB_DIR . DIRECTORY_SEPARATOR; |
|
363 | + $base = WEB_DIR.DIRECTORY_SEPARATOR; |
|
364 | 364 | $file = ""; |
365 | 365 | $html_base = ""; |
366 | 366 | $debug = Config::getInstance()->getDebugMode(); |
367 | 367 | $cache = Config::getInstance()->get('cache.var'); |
368 | - $cache = $cache ? '.' . $cache : ''; |
|
368 | + $cache = $cache ? '.'.$cache : ''; |
|
369 | 369 | $finfo = finfo_open(FILEINFO_MIME_TYPE); // devuelve el tipo mime de su extensión |
370 | 370 | $mime = finfo_file($finfo, $filename_path); |
371 | 371 | finfo_close($finfo); |
372 | 372 | if (preg_match('/\.css$/i', $string)) { |
373 | - $file = "/" . substr(md5($string), 0, 8) . "$cache.css"; |
|
373 | + $file = "/".substr(md5($string), 0, 8)."$cache.css"; |
|
374 | 374 | $html_base = "css"; |
375 | 375 | if ($debug) { |
376 | - $file = str_replace(".css", "_" . $original_filename, $file); |
|
376 | + $file = str_replace(".css", "_".$original_filename, $file); |
|
377 | 377 | } |
378 | 378 | } elseif (preg_match('/\.js$/i', $string)) { |
379 | - $file = "/" . substr(md5($string), 0, 8) . "$cache.js"; |
|
379 | + $file = "/".substr(md5($string), 0, 8)."$cache.js"; |
|
380 | 380 | $html_base = "js"; |
381 | 381 | if ($debug) { |
382 | - $file = str_replace(".js", "_" . $original_filename, $file); |
|
382 | + $file = str_replace(".js", "_".$original_filename, $file); |
|
383 | 383 | } |
384 | 384 | } elseif (preg_match("/image/i", $mime)) { |
385 | 385 | $ext = explode(".", $string); |
386 | - $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1]; |
|
386 | + $file = "/".substr(md5($string), 0, 8).".".$ext[count($ext) - 1]; |
|
387 | 387 | $html_base = "img"; |
388 | 388 | if ($debug) { |
389 | - $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file); |
|
389 | + $file = str_replace(".".$ext[count($ext) - 1], "_".$original_filename, $file); |
|
390 | 390 | } |
391 | 391 | } elseif (preg_match("/(doc|pdf)/i", $mime)) { |
392 | 392 | $ext = explode(".", $string); |
393 | - $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1]; |
|
393 | + $file = "/".substr(md5($string), 0, 8).".".$ext[count($ext) - 1]; |
|
394 | 394 | $html_base = "docs"; |
395 | 395 | if ($debug) { |
396 | - $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file); |
|
396 | + $file = str_replace(".".$ext[count($ext) - 1], "_".$original_filename, $file); |
|
397 | 397 | } |
398 | 398 | } elseif (preg_match("/(video|audio|ogg)/i", $mime)) { |
399 | 399 | $ext = explode(".", $string); |
400 | - $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1]; |
|
400 | + $file = "/".substr(md5($string), 0, 8).".".$ext[count($ext) - 1]; |
|
401 | 401 | $html_base = "media"; |
402 | 402 | if ($debug) { |
403 | - $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file); |
|
403 | + $file = str_replace(".".$ext[count($ext) - 1], "_".$original_filename, $file); |
|
404 | 404 | } |
405 | 405 | } elseif (preg_match("/(text|html)/i", $mime)) { |
406 | 406 | $ext = explode(".", $string); |
407 | - $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1]; |
|
407 | + $file = "/".substr(md5($string), 0, 8).".".$ext[count($ext) - 1]; |
|
408 | 408 | $html_base = "templates"; |
409 | 409 | if ($debug) { |
410 | - $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file); |
|
410 | + $file = str_replace(".".$ext[count($ext) - 1], "_".$original_filename, $file); |
|
411 | 411 | } |
412 | 412 | } elseif (!$return && !is_null($name)) { |
413 | 413 | $html_base = ''; |
414 | 414 | $file = $name; |
415 | 415 | } |
416 | - $file_path = $html_base . $file; |
|
416 | + $file_path = $html_base.$file; |
|
417 | 417 | |
418 | 418 | return array($base, $html_base, $file_path); |
419 | 419 | } |
@@ -432,10 +432,10 @@ discard block |
||
432 | 432 | foreach ($urls as $source) { |
433 | 433 | $orig = self::calculateResourcePathname($filename_path, $source); |
434 | 434 | $orig_part = preg_split("/Public/i", $orig); |
435 | - $dest = WEB_DIR . $orig_part[1]; |
|
435 | + $dest = WEB_DIR.$orig_part[1]; |
|
436 | 436 | GeneratorHelper::createDir(dirname($dest)); |
437 | 437 | if (@copy($orig, $dest) === false) { |
438 | - throw new ConfigException("Can't copy " . $orig . " to " . $dest); |
|
438 | + throw new ConfigException("Can't copy ".$orig." to ".$dest); |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | } |