@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function init() |
99 | 99 | { |
100 | - if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE)) { |
|
100 | + if (file_exists(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE)) { |
|
101 | 101 | $this->loadConfigData(); |
102 | 102 | } |
103 | 103 | return $this; |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | $finalData = self::saveExtraParams($data); |
213 | 213 | $saved = false; |
214 | 214 | try { |
215 | - $finalData = array_filter($finalData, function ($key, $value) { |
|
215 | + $finalData = array_filter($finalData, function($key, $value) { |
|
216 | 216 | return in_array($key, self::$required, true) || !empty($value); |
217 | 217 | }, ARRAY_FILTER_USE_BOTH); |
218 | - $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($finalData, JSON_PRETTY_PRINT))); |
|
218 | + $saved = (false !== file_put_contents(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE, json_encode($finalData, JSON_PRETTY_PRINT))); |
|
219 | 219 | self::getInstance()->loadConfigData(); |
220 | 220 | $saved = true; |
221 | - } catch (ConfigException $e) { |
|
221 | + }catch (ConfigException $e) { |
|
222 | 222 | Logger::log($e->getMessage(), LOG_ERR); |
223 | 223 | } |
224 | 224 | return $saved; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function loadConfigData(): void |
252 | 252 | { |
253 | - $this->config = json_decode(file_get_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE), true) ?: []; |
|
253 | + $this->config = json_decode(file_get_contents(CONFIG_DIR.DIRECTORY_SEPARATOR.self::CONFIG_FILE), true) ?: []; |
|
254 | 254 | $this->debug = array_key_exists('debug', $this->config) ? (bool)$this->config['debug'] : FALSE; |
255 | 255 | if (array_key_exists('cache.var', $this->config)) { |
256 | 256 | Security::getInstance()->setSessionKey('config.cache.var', $this->config['cache.var']); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | public static function getParam(string $key, mixed $defaultValue = null, string $module = null): mixed |
276 | 276 | { |
277 | 277 | if (null !== $module) { |
278 | - return self::getParam(strtolower($module) . '.' . $key, self::getParam($key, $defaultValue)); |
|
278 | + return self::getParam(strtolower($module).'.'.$key, self::getParam($key, $defaultValue)); |
|
279 | 279 | } |
280 | 280 | $param = self::getInstance()->get($key); |
281 | 281 | return (null !== $param) ? $param : $defaultValue; |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | { |
292 | 292 | $done = true; |
293 | 293 | foreach (self::$cleanable_config_files as $configFile) { |
294 | - if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . $configFile)) { |
|
295 | - if (!unlink(CONFIG_DIR . DIRECTORY_SEPARATOR . $configFile)) { |
|
294 | + if (file_exists(CONFIG_DIR.DIRECTORY_SEPARATOR.$configFile)) { |
|
295 | + if (!unlink(CONFIG_DIR.DIRECTORY_SEPARATOR.$configFile)) { |
|
296 | 296 | $done = false; |
297 | 297 | } |
298 | 298 | } |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | |
19 | 19 | |
20 | 20 | if (!defined('LOG_DIR')) { |
21 | - GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
22 | - define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
21 | + GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
22 | + define('LOG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | { |
60 | 60 | $args = func_get_args(); |
61 | 61 | list($logger, $debug, $path) = $this->setup($args); |
62 | - $this->stream = fopen($path . DIRECTORY_SEPARATOR . date('Ymd') . '.log', 'ab+'); |
|
62 | + $this->stream = fopen($path.DIRECTORY_SEPARATOR.date('Ymd').'.log', 'ab+'); |
|
63 | 63 | if (false !== $this->stream && is_resource($this->stream)) { |
64 | 64 | $this->addPushLogger($logger, $debug); |
65 | - } else { |
|
65 | + }else { |
|
66 | 66 | throw new ConfigException(t('Error creating logger')); |
67 | 67 | } |
68 | 68 | $this->logLevel = strtoupper(Config::getParam('log.level', 'NOTICE')); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | private function createLoggerPath(): string |
142 | 142 | { |
143 | 143 | $logger = $this->setLoggerName(); |
144 | - $path = Config::getParam('default.log.path', LOG_DIR) . DIRECTORY_SEPARATOR . $logger . DIRECTORY_SEPARATOR . date('Y') . DIRECTORY_SEPARATOR . date('m'); |
|
144 | + $path = Config::getParam('default.log.path', LOG_DIR).DIRECTORY_SEPARATOR.$logger.DIRECTORY_SEPARATOR.date('Y').DIRECTORY_SEPARATOR.date('m'); |
|
145 | 145 | GeneratorHelper::createDir($path); |
146 | 146 | return $path; |
147 | 147 | } |