@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $this->setStatusHeader(); |
| 128 | 128 | $this->setAuthHeaders(); |
| 129 | 129 | $this->setCookieHeaders($cookies); |
| 130 | - header('Content-type: ' . $contentType); |
|
| 130 | + header('Content-type: '.$contentType); |
|
| 131 | 131 | |
| 132 | 132 | } |
| 133 | 133 | |
@@ -143,14 +143,14 @@ discard block |
||
| 143 | 143 | Logger::log('Start output response'); |
| 144 | 144 | ob_start(); |
| 145 | 145 | $this->setReponseHeaders($contentType, $cookies); |
| 146 | - header('Content-length: ' . strlen($output)); |
|
| 146 | + header('Content-length: '.strlen($output)); |
|
| 147 | 147 | |
| 148 | 148 | $cache = Cache::needCache(); |
| 149 | 149 | if (false !== $cache && $this->status_code === Template::STATUS_OK && $this->debug === false) { |
| 150 | 150 | Logger::log('Saving output response into cache'); |
| 151 | 151 | $cacheName = $this->cache->getRequestCacheHash(); |
| 152 | - $this->cache->storeData("json" . DIRECTORY_SEPARATOR . $cacheName, $output); |
|
| 153 | - $this->cache->storeData("json" . DIRECTORY_SEPARATOR . $cacheName . ".headers", headers_list(), Cache::JSON); |
|
| 152 | + $this->cache->storeData("json".DIRECTORY_SEPARATOR.$cacheName, $output); |
|
| 153 | + $this->cache->storeData("json".DIRECTORY_SEPARATOR.$cacheName.".headers", headers_list(), Cache::JSON); |
|
| 154 | 154 | } |
| 155 | 155 | echo $output; |
| 156 | 156 | |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | Logger::log('Close template render'); |
| 169 | 169 | Security::getInstance()->setSessionKey("lastRequest", array( |
| 170 | - "url" => Request::getInstance()->getRootUrl() . Request::requestUri(), |
|
| 170 | + "url" => Request::getInstance()->getRootUrl().Request::requestUri(), |
|
| 171 | 171 | "ts" => microtime(true), |
| 172 | 172 | )); |
| 173 | 173 | Security::getInstance()->updateSession(); |
| 174 | - Logger::log('End request: ' . Request::requestUri(), LOG_INFO); |
|
| 174 | + Logger::log('End request: '.Request::requestUri(), LOG_INFO); |
|
| 175 | 175 | exit; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $dump = ''; |
| 221 | 221 | try { |
| 222 | 222 | $dump = $this->tpl->render($tpl, $vars); |
| 223 | - } catch (\Exception $e) { |
|
| 223 | + }catch (\Exception $e) { |
|
| 224 | 224 | Logger::log($e->getMessage(), LOG_ERR); |
| 225 | 225 | } |
| 226 | 226 | return $dump; |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | public function regenerateTemplates() |
| 335 | 335 | { |
| 336 | 336 | $this->generateTemplatesCache(); |
| 337 | - $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . "domains.json", Cache::JSON, true); |
|
| 337 | + $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR."domains.json", Cache::JSON, true); |
|
| 338 | 338 | $translations = []; |
| 339 | 339 | if (is_array($domains)) { |
| 340 | 340 | $translations = $this->parsePathTranslations($domains); |
@@ -356,8 +356,8 @@ discard block |
||
| 356 | 356 | // force compilation |
| 357 | 357 | if ($file->isFile()) { |
| 358 | 358 | try { |
| 359 | - $this->tpl->loadTemplate(str_replace($tplDir . '/', '', $file)); |
|
| 360 | - } catch (\Exception $e) { |
|
| 359 | + $this->tpl->loadTemplate(str_replace($tplDir.'/', '', $file)); |
|
| 360 | + }catch (\Exception $e) { |
|
| 361 | 361 | Logger::log($e->getMessage(), LOG_ERR); |
| 362 | 362 | throw $e; |
| 363 | 363 | } |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | unset($_SERVER["PHP_AUTH_USER"]); |
| 429 | 429 | unset($_SERVER["PHP_AUTH_PW"]); |
| 430 | 430 | header_remove("Authorization"); |
| 431 | - } else { |
|
| 431 | + }else { |
|
| 432 | 432 | header('Authorization:'); |
| 433 | 433 | } |
| 434 | 434 | } |
@@ -455,9 +455,9 @@ discard block |
||
| 455 | 455 | Logger::log('Adding debug headers to render response'); |
| 456 | 456 | $vars["__DEBUG__"]["includes"] = get_included_files(); |
| 457 | 457 | $vars["__DEBUG__"]["trace"] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 458 | - header('X-PSFS-DEBUG-TS: ' . Dispatcher::getInstance()->getTs() . ' s'); |
|
| 459 | - header('X-PSFS-DEBUG-MEM: ' . Dispatcher::getInstance()->getMem('MBytes') . ' MBytes'); |
|
| 460 | - header('X-PSFS-DEBUG-FILES: ' . count(get_included_files()) . ' files opened'); |
|
| 458 | + header('X-PSFS-DEBUG-TS: '.Dispatcher::getInstance()->getTs().' s'); |
|
| 459 | + header('X-PSFS-DEBUG-MEM: '.Dispatcher::getInstance()->getMem('MBytes').' MBytes'); |
|
| 460 | + header('X-PSFS-DEBUG-FILES: '.count(get_included_files()).' files opened'); |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | return $vars; |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $this->cache = Cache::getInstance(); |
| 500 | 500 | $loader = new \Twig_Loader_Filesystem(Config::getInstance()->getTemplatePath()); |
| 501 | 501 | $this->tpl = new \Twig_Environment($loader, array( |
| 502 | - 'cache' => Config::getInstance()->getCachePath() . DIRECTORY_SEPARATOR . 'twig', |
|
| 502 | + 'cache' => Config::getInstance()->getCachePath().DIRECTORY_SEPARATOR.'twig', |
|
| 503 | 503 | 'debug' => (bool)$this->debug, |
| 504 | 504 | 'auto_reload' => TRUE, |
| 505 | 505 | )); |