@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | protected function init() |
| 87 | 87 | { |
| 88 | - if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE)) { |
|
| 88 | + if (file_exists(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE)) { |
|
| 89 | 89 | $this->loadConfigData(); |
| 90 | 90 | } |
| 91 | 91 | return $this; |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | $finalData = array_filter($finalData, function($key, $value) { |
| 202 | 202 | return in_array($key, self::$required, true) || !empty($value); |
| 203 | 203 | }, ARRAY_FILTER_USE_BOTH); |
| 204 | - $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($finalData, JSON_PRETTY_PRINT))); |
|
| 204 | + $saved = (false !== file_put_contents(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE, json_encode($finalData, JSON_PRETTY_PRINT))); |
|
| 205 | 205 | self::getInstance()->loadConfigData(); |
| 206 | 206 | $saved = true; |
| 207 | - } catch (ConfigException $e) { |
|
| 207 | + }catch (ConfigException $e) { |
|
| 208 | 208 | Logger::log($e->getMessage(), LOG_ERR); |
| 209 | 209 | } |
| 210 | 210 | return $saved; |
@@ -236,9 +236,9 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function loadConfigData() |
| 238 | 238 | { |
| 239 | - $this->config = json_decode(file_get_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE), true) ?: []; |
|
| 239 | + $this->config = json_decode(file_get_contents(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE), true) ?: []; |
|
| 240 | 240 | $this->debug = array_key_exists('debug', $this->config) ? (bool)$this->config['debug'] : FALSE; |
| 241 | - if(array_key_exists('cache.var', $this->config)) { |
|
| 241 | + if (array_key_exists('cache.var', $this->config)) { |
|
| 242 | 242 | Security::getInstance()->setSessionKey('config.cache.var', $this->config['cache.var']); |
| 243 | 243 | } |
| 244 | 244 | } |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public static function getParam($key, $defaultValue = null, $module = null) |
| 262 | 262 | { |
| 263 | - if(null !== $module) { |
|
| 264 | - return self::getParam(strtolower($module) . '.' . $key, self::getParam($key, $defaultValue)); |
|
| 263 | + if (null !== $module) { |
|
| 264 | + return self::getParam(strtolower($module).'.'.$key, self::getParam($key, $defaultValue)); |
|
| 265 | 265 | } |
| 266 | 266 | $param = self::getInstance()->get($key); |
| 267 | 267 | return (null !== $param) ? $param : $defaultValue; |