@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | use PSFS\base\Logger; |
| 14 | 14 | use PSFS\base\Singleton; |
| 15 | 15 | |
| 16 | -require_once __DIR__ . DIRECTORY_SEPARATOR . "bootstrap.php"; |
|
| 16 | +require_once __DIR__.DIRECTORY_SEPARATOR."bootstrap.php"; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Class Dispatcher |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | private function setLocale() |
| 75 | 75 | { |
| 76 | 76 | $this->locale = $this->config->get("default_language"); |
| 77 | - Logger::log('Set locale to project [' . $this->locale . ']'); |
|
| 77 | + Logger::log('Set locale to project ['.$this->locale.']'); |
|
| 78 | 78 | // Load translations |
| 79 | - putenv("LC_ALL=" . $this->locale); |
|
| 79 | + putenv("LC_ALL=".$this->locale); |
|
| 80 | 80 | setlocale(LC_ALL, $this->locale); |
| 81 | 81 | // Load the locale path |
| 82 | - $locale_path = BASE_DIR . DIRECTORY_SEPARATOR . 'locale'; |
|
| 83 | - Logger::log('Set locale dir ' . $locale_path); |
|
| 82 | + $locale_path = BASE_DIR.DIRECTORY_SEPARATOR.'locale'; |
|
| 83 | + Logger::log('Set locale dir '.$locale_path); |
|
| 84 | 84 | Config::createDir($locale_path); |
| 85 | 85 | bindtextdomain('translations', $locale_path); |
| 86 | 86 | textdomain('translations'); |
@@ -100,16 +100,16 @@ discard block |
||
| 100 | 100 | if (!$this->parser->isFile()) { |
| 101 | 101 | return $this->router->execute($this->actualUri); |
| 102 | 102 | } |
| 103 | - } else { |
|
| 103 | + }else { |
|
| 104 | 104 | return $this->router->getAdmin()->config(); |
| 105 | 105 | } |
| 106 | - } catch (ConfigException $c) { |
|
| 106 | + }catch (ConfigException $c) { |
|
| 107 | 107 | return $this->dumpException($c); |
| 108 | - } catch (SecurityException $s) { |
|
| 108 | + }catch (SecurityException $s) { |
|
| 109 | 109 | return $this->security->notAuthorized($this->actualUri); |
| 110 | - } catch (RouterException $r) { |
|
| 110 | + }catch (RouterException $r) { |
|
| 111 | 111 | return $this->router->httpNotFound($r); |
| 112 | - } catch (\Exception $e) { |
|
| 112 | + }catch (\Exception $e) { |
|
| 113 | 113 | return $this->dumpException($e); |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $use /= 1024; |
| 152 | 152 | break; |
| 153 | 153 | case "MBytes": |
| 154 | - $use /= (1024 * 1024); |
|
| 154 | + $use /= (1024*1024); |
|
| 155 | 155 | break; |
| 156 | 156 | case "Bytes": |
| 157 | 157 | default: |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | if ($this->config->getDebugMode()) { |
| 178 | 178 | Logger::log('Added handlers for errors'); |
| 179 | 179 | //Warning & Notice handler |
| 180 | - set_error_handler(function ($errno, $errstr, $errfile, $errline) { |
|
| 180 | + set_error_handler(function($errno, $errstr, $errfile, $errline) { |
|
| 181 | 181 | Logger::log($errstr, LOG_CRIT, ['file' => $errfile, 'line' => $errline]); |
| 182 | 182 | throw new \Exception($errstr, 500); |
| 183 | 183 | }); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | Logger::log('Initialicing stats (mem + ts)'); |
| 193 | 193 | if (null !== $_SERVER && array_key_exists('REQUEST_TIME_FLOAT', $_SERVER)) { |
| 194 | 194 | $this->ts = (float)$_SERVER['REQUEST_TIME_FLOAT']; |
| 195 | - } else { |
|
| 195 | + }else { |
|
| 196 | 196 | $this->ts = $this->parser->getTs(); |
| 197 | 197 | } |
| 198 | 198 | $this->mem = memory_get_usage(); |