@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | use PSFS\base\Singleton; |
| 17 | 17 | use PSFS\controller\ConfigController; |
| 18 | 18 | |
| 19 | -require_once __DIR__ . DIRECTORY_SEPARATOR . "bootstrap.php"; |
|
| 19 | +require_once __DIR__.DIRECTORY_SEPARATOR."bootstrap.php"; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Class Dispatcher |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | private function setLocale() |
| 78 | 78 | { |
| 79 | 79 | $this->locale = $this->config->get("default_language"); |
| 80 | - Logger::log('Set locale to project [' . $this->locale . ']'); |
|
| 80 | + Logger::log('Set locale to project ['.$this->locale.']'); |
|
| 81 | 81 | // Load translations |
| 82 | - putenv("LC_ALL=" . $this->locale); |
|
| 82 | + putenv("LC_ALL=".$this->locale); |
|
| 83 | 83 | setlocale(LC_ALL, $this->locale); |
| 84 | 84 | // Load the locale path |
| 85 | - $locale_path = BASE_DIR . DIRECTORY_SEPARATOR . 'locale'; |
|
| 86 | - Logger::log('Set locale dir ' . $locale_path); |
|
| 85 | + $locale_path = BASE_DIR.DIRECTORY_SEPARATOR.'locale'; |
|
| 86 | + Logger::log('Set locale dir '.$locale_path); |
|
| 87 | 87 | Config::createDir($locale_path); |
| 88 | 88 | bindtextdomain('translations', $locale_path); |
| 89 | 89 | textdomain('translations'); |
@@ -104,18 +104,18 @@ discard block |
||
| 104 | 104 | if (!$this->parser->isFile()) { |
| 105 | 105 | return $this->router->execute($this->actualUri); |
| 106 | 106 | } |
| 107 | - } else { |
|
| 107 | + }else { |
|
| 108 | 108 | return ConfigController::getInstance()->config(); |
| 109 | 109 | } |
| 110 | - } catch (ConfigException $c) { |
|
| 110 | + }catch (ConfigException $c) { |
|
| 111 | 111 | return $this->dumpException($c); |
| 112 | - } catch (SecurityException $s) { |
|
| 112 | + }catch (SecurityException $s) { |
|
| 113 | 113 | return $this->security->notAuthorized($this->actualUri); |
| 114 | - } catch (UserAuthException $u) { |
|
| 114 | + }catch (UserAuthException $u) { |
|
| 115 | 115 | Request::getInstance()->redirect($this->router->getRoute($this->config->get('home_action'))); |
| 116 | - } catch (RouterException $r) { |
|
| 116 | + }catch (RouterException $r) { |
|
| 117 | 117 | return $this->router->httpNotFound($r); |
| 118 | - } catch (\Exception $e) { |
|
| 118 | + }catch (\Exception $e) { |
|
| 119 | 119 | return $this->dumpException($e); |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $use /= 1024; |
| 158 | 158 | break; |
| 159 | 159 | case "MBytes": |
| 160 | - $use /= (1024 * 1024); |
|
| 160 | + $use /= (1024*1024); |
|
| 161 | 161 | break; |
| 162 | 162 | case "Bytes": |
| 163 | 163 | default: |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if ($this->config->getDebugMode()) { |
| 184 | 184 | Logger::log('Added handlers for errors'); |
| 185 | 185 | //Warning & Notice handler |
| 186 | - set_error_handler(function ($errno, $errstr, $errfile, $errline) { |
|
| 186 | + set_error_handler(function($errno, $errstr, $errfile, $errline) { |
|
| 187 | 187 | Logger::log($errstr, LOG_CRIT, ['file' => $errfile, 'line' => $errline]); |
| 188 | 188 | throw new \Exception($errstr, 500); |
| 189 | 189 | }); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | Logger::log('Initialicing stats (mem + ts)'); |
| 199 | 199 | if (null !== $_SERVER && array_key_exists('REQUEST_TIME_FLOAT', $_SERVER)) { |
| 200 | 200 | $this->ts = (float)$_SERVER['REQUEST_TIME_FLOAT']; |
| 201 | - } else { |
|
| 201 | + }else { |
|
| 202 | 202 | $this->ts = $this->parser->getTs(); |
| 203 | 203 | } |
| 204 | 204 | $this->mem = memory_get_usage(); |