@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | $fullPath = $xoops->path("{$path}/locale/{$locale}/locale.php"); |
222 | 222 | $fullPath2 = $xoops->path("{$path}/locale/{$locale}/{$locale}.php"); |
223 | 223 | if (\XoopsLoad::fileExists($fullPath)) { |
224 | - \XoopsLoad::addMap(array($domain . 'locale' => $fullPath)); |
|
224 | + \XoopsLoad::addMap(array($domain.'locale' => $fullPath)); |
|
225 | 225 | if (\XoopsLoad::fileExists($fullPath2)) { |
226 | - \XoopsLoad::addMap(array(strtolower($domain . "locale{$locale}") => $fullPath2)); |
|
226 | + \XoopsLoad::addMap(array(strtolower($domain."locale{$locale}") => $fullPath2)); |
|
227 | 227 | } |
228 | 228 | return true; |
229 | 229 | } |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | $fullPath = $xoops->path($theme->resourcePath("locale/{$locale}/locale.php")); |
247 | 247 | $fullPath2 = $xoops->path($theme->resourcePath("locale/{$locale}/{$locale}.php")); |
248 | 248 | if (\XoopsLoad::fileExists($fullPath)) { |
249 | - \XoopsLoad::addMap(array(strtolower($theme->folderName . 'ThemeLocale') => $fullPath)); |
|
249 | + \XoopsLoad::addMap(array(strtolower($theme->folderName.'ThemeLocale') => $fullPath)); |
|
250 | 250 | if (\XoopsLoad::fileExists($fullPath2)) { |
251 | - \XoopsLoad::addMap(array(strtolower($theme->folderName . "ThemeLocale{$locale}") => $fullPath2)); |
|
251 | + \XoopsLoad::addMap(array(strtolower($theme->folderName."ThemeLocale{$locale}") => $fullPath2)); |
|
252 | 252 | } |
253 | 253 | return true; |
254 | 254 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | $p = []; |
348 | 348 | foreach ($params as $name => $value) { |
349 | - $p['{' . $name . '}'] = $value; |
|
349 | + $p['{'.$name.'}'] = $value; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | return strtr($message, $p); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | protected static function getClassFromDirname($dirname) |
374 | 374 | { |
375 | - return ucfirst($dirname) . 'Locale'; |
|
375 | + return ucfirst($dirname).'Locale'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | if (!$dirname) { |
386 | 386 | $dirname = \Xoops::getInstance()->theme()->folderName; |
387 | 387 | } |
388 | - return ucfirst($dirname) . 'ThemeLocale'; |
|
388 | + return ucfirst($dirname).'ThemeLocale'; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
@@ -461,8 +461,8 @@ discard block |
||
461 | 461 | $keys = Data::explodeLocale($locale); |
462 | 462 | $key = strtolower($keys['language']); |
463 | 463 | $key .= (empty($keys['script']) || false === $withScript) ? |
464 | - '' : $separator . ucfirst(strtolower($keys['script'])); |
|
465 | - $key .= empty($keys['territory']) ? '' : $separator . strtoupper($keys['territory']); |
|
464 | + '' : $separator.ucfirst(strtolower($keys['script'])); |
|
465 | + $key .= empty($keys['territory']) ? '' : $separator.strtoupper($keys['territory']); |
|
466 | 466 | } catch (InvalidLocale $e) { |
467 | 467 | $key = ''; |
468 | 468 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $name = $this->xoops->getConfig('session_name'); |
84 | 84 | $name = (empty($name)) ? 'xoops_session' : $name; |
85 | 85 | $expire = (int)($this->xoops->getConfig('session_expire')); |
86 | - $expire = ($expire>0) ? $expire : 300; |
|
86 | + $expire = ($expire > 0) ? $expire : 300; |
|
87 | 87 | |
88 | 88 | $path = \XoopsBaseConfig::get('cookie-path'); |
89 | 89 | $domain = \XoopsBaseConfig::get('cookie-domain'); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | // if we don't have the expires key, use a future value for test |
201 | - if ($this->get('SESSION_MANAGER_EXPIRES', time()+10) < time()) { |
|
201 | + if ($this->get('SESSION_MANAGER_EXPIRES', time() + 10) < time()) { |
|
202 | 202 | return false; |
203 | 203 | } |
204 | 204 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->now = time(); |
97 | 97 | $cookieData = $this->readUserCookie(); |
98 | 98 | if (false === $cookieData) { |
99 | - return false; // no or invalid cookie |
|
99 | + return false; // no or invalid cookie |
|
100 | 100 | } |
101 | 101 | list($userId, $series, $token) = $cookieData; |
102 | 102 | $this->readUserTokens($userId); |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | if ($cookieData !== $notFound) { |
381 | 381 | $temp = explode('-', $cookieData); |
382 | 382 | if (count($temp) == 3) { |
383 | - $temp[0] = (integer) $temp[0]; |
|
383 | + $temp[0] = (integer)$temp[0]; |
|
384 | 384 | return $temp; |
385 | 385 | } |
386 | 386 | $this->clearUserCookie(); // clean up garbage cookie |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function checkSessionPrint(AttributeInterface $session) |
79 | 79 | { |
80 | - $score = 0; // combined levenshtein distance of changes |
|
80 | + $score = 0; // combined levenshtein distance of changes |
|
81 | 81 | $changes = 0; // number of changed fields |
82 | 82 | $currentFingerprint = $this->takePrint(); |
83 | 83 | $savedFingerprint = unserialize($session->get('SESSION_FINGERPRINT')); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | foreach ($currentFingerprint as $key => $current) { |
90 | 90 | $distance = levenshtein($current, $savedFingerprint[$key]); |
91 | 91 | $score += $distance; |
92 | - $changes += ($distance>0) ? 1 : 0; |
|
92 | + $changes += ($distance > 0) ? 1 : 0; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | $return = true; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | **/ |
112 | 112 | public function write($session_id, $session_data) |
113 | 113 | { |
114 | - $expires = (isset($_SESSION['SESSION_MANAGER_EXPIRES'])) |
|
114 | + $expires = (isset($_SESSION['SESSION_MANAGER_EXPIRES'])) |
|
115 | 115 | ? (int)($_SESSION['SESSION_MANAGER_EXPIRES']) |
116 | 116 | : time() + (session_cache_expire() * 60); |
117 | 117 | //$oldIsolation = $this->db->getTransactionIsolation(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ->setParameter(':sessdata', $session_data, \PDO::PARAM_STR); |
130 | 130 | $this->db->setForce(true); |
131 | 131 | $result = $qb->execute(); |
132 | - if ($result<=0) { |
|
132 | + if ($result <= 0) { |
|
133 | 133 | $qb = $this->db->createXoopsQueryBuilder(); |
134 | 134 | $qb ->insertPrefix($this->sessionTable) |
135 | 135 | ->values(array( |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | //$this->db->commit(); |
147 | 147 | //$this->db->setTransactionIsolation($oldIsolation); |
148 | 148 | |
149 | - return (boolean) ($result>0); |
|
149 | + return (boolean)($result > 0); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -186,6 +186,6 @@ discard block |
||
186 | 186 | ->setParameter(':expires', $mintime, \PDO::PARAM_INT); |
187 | 187 | $this->db->setForce(true); |
188 | 188 | $result = $qb->execute(); |
189 | - return (boolean) ($result>0); |
|
189 | + return (boolean)($result > 0); |
|
190 | 190 | } |
191 | 191 | } |
@@ -57,8 +57,8 @@ |
||
57 | 57 | { |
58 | 58 | $this->xoops = \Xoops::getInstance(); |
59 | 59 | $defaults = $this->getDefaults(); |
60 | - $xoops_var_path = \XoopsBaseConfig::get('var-path'); |
|
61 | - $cache_file = $xoops_var_path . '/configs/cache.php'; |
|
60 | + $xoops_var_path = \XoopsBaseConfig::get('var-path'); |
|
61 | + $cache_file = $xoops_var_path . '/configs/cache.php'; |
|
62 | 62 | $poolDefs = Yaml::readWrapped($cache_file); |
63 | 63 | if (empty($poolDefs)) { |
64 | 64 | Yaml::saveWrapped($defaults, $cache_file); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->xoops = \Xoops::getInstance(); |
59 | 59 | $defaults = $this->getDefaults(); |
60 | 60 | $xoops_var_path = \XoopsBaseConfig::get('var-path'); |
61 | - $cache_file = $xoops_var_path . '/configs/cache.php'; |
|
61 | + $cache_file = $xoops_var_path.'/configs/cache.php'; |
|
62 | 62 | $poolDefs = Yaml::readWrapped($cache_file); |
63 | 63 | if (empty($poolDefs)) { |
64 | 64 | Yaml::saveWrapped($defaults, $cache_file); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $defaults = [ |
79 | 79 | 'default' => [ |
80 | 80 | 'driver' => 'Sqlite', |
81 | - 'options' => ['path' => \XoopsBaseConfig::get('var-path') . '/stash/'], |
|
81 | + 'options' => ['path' => \XoopsBaseConfig::get('var-path').'/stash/'], |
|
82 | 82 | ], |
83 | 83 | 'temp' => [ |
84 | 84 | 'driver' => 'Ephemeral', |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function createDefaultConfig() |
113 | 113 | { |
114 | - $configFile = \XoopsBaseConfig::get('var-path') . '/configs/cache.php'; |
|
114 | + $configFile = \XoopsBaseConfig::get('var-path').'/configs/cache.php'; |
|
115 | 115 | if (file_exists($configFile)) { |
116 | 116 | return; |
117 | 117 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $defaults['default']['driver'] = 'FileSystem'; |
121 | 121 | $defaults['default']['options'] = [ |
122 | 122 | 'dirSplit' => 1, |
123 | - 'path' => \XoopsBaseConfig::get('var-path') . '/stash/' |
|
123 | + 'path' => \XoopsBaseConfig::get('var-path').'/stash/' |
|
124 | 124 | ]; |
125 | 125 | if (false !== stripos(PHP_OS, 'WIN')) { |
126 | 126 | trigger_error("SQLite is strongly recommended on windows due to 260 character file path restrictions."); |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | { |
141 | 141 | $pool = false; |
142 | 142 | if (array_key_exists($name, $this->pools)) { |
143 | - $pool = $this->pools[$name]; |
|
143 | + $pool = $this->pools[$name]; |
|
144 | 144 | } elseif (array_key_exists($name, $this->poolDefs)) { |
145 | - $pool = $this->startPoolAccess($name); |
|
145 | + $pool = $this->startPoolAccess($name); |
|
146 | 146 | } |
147 | 147 | if ($pool === false) { |
148 | 148 | $pool = $this->getDefaultPool($name); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | $driver = $this->getDriver($driverName, $options); |
181 | - if ($driver!==false) { |
|
181 | + if ($driver !== false) { |
|
182 | 182 | $pool = new Pool($driver); |
183 | 183 | if (is_object($pool)) { |
184 | 184 | $pool->setLogger($this->xoops->logger()); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $driver = false; |
207 | 207 | $driverClass = DriverList::getDriverClass($driverName); |
208 | 208 | |
209 | - if ($driverClass!==false && $driverClass::isAvailable()) { |
|
209 | + if ($driverClass !== false && $driverClass::isAvailable()) { |
|
210 | 210 | $options = is_array($options) ? $options : array(); |
211 | 211 | $driver = new $driverClass($options); |
212 | 212 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | return $this->pools[$name]; |
230 | 230 | } |
231 | 231 | $pool = $this->startPoolAccess($name); |
232 | - if ($pool===false) { |
|
232 | + if ($pool === false) { |
|
233 | 233 | $this->xoops->logger()->error('Could not create default cache pool'); |
234 | 234 | $pool = new Access(new \Stash\Pool()); |
235 | 235 | } |
@@ -34,12 +34,12 @@ |
||
34 | 34 | $stack = debug_backtrace(); |
35 | 35 | $frameSelf = $stack[1]; |
36 | 36 | $frame = isset($stack[2]) ? $stack[2] : false; |
37 | - $append = ' ' . get_called_class() . '::' . $frameSelf['function'] . '() called from '; |
|
37 | + $append = ' '.get_called_class().'::'.$frameSelf['function'].'() called from '; |
|
38 | 38 | if ($frame !== false) { |
39 | - $append .= $frame['function'] . '() in '; |
|
39 | + $append .= $frame['function'].'() in '; |
|
40 | 40 | } |
41 | - $append .= $frameSelf['file'] . ' line '. $frameSelf['line']; |
|
42 | - \Xoops::getInstance()->deprecated($message . $append); |
|
41 | + $append .= $frameSelf['file'].' line '.$frameSelf['line']; |
|
42 | + \Xoops::getInstance()->deprecated($message.$append); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $countLeft = 0; |
83 | 83 | $countRight = -1; |
84 | 84 | $temp = str_replace('<{', '{', $tpl_source, $countLeft); |
85 | - if ($countLeft>0) { |
|
85 | + if ($countLeft > 0) { |
|
86 | 86 | $temp = str_replace('}>', '}', $temp, $countRight); |
87 | 87 | } |
88 | 88 | return ($countLeft === $countRight) ? $temp : $tpl_source; |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | $template_set = empty($template_set) ? $xoops->getConfig('template_set') : $template_set; |
122 | 122 | $theme_set = empty($theme_set) ? $xoops->getConfig('theme_set') : $theme_set; |
123 | 123 | $module_dirname = empty($module_dirname) ? $xoops->moduleDirname : $module_dirname; |
124 | - $this->compile_id = substr(md5(\XoopsBaseConfig::get('url')), 0, 8) . '-' . $module_dirname |
|
125 | - . '-' . $theme_set . '-' . $template_set; |
|
124 | + $this->compile_id = substr(md5(\XoopsBaseConfig::get('url')), 0, 8).'-'.$module_dirname |
|
125 | + . '-'.$theme_set.'-'.$template_set; |
|
126 | 126 | //$this->_compile_id = $this->compile_id; |
127 | 127 | } |
128 | 128 | |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | $compile_id = $this->compile_id; |
149 | 149 | $this->compile_id = $hold_compile_id; |
150 | 150 | $compile_id = preg_replace('![^\w\|]+!', '_', $compile_id); |
151 | - $glob = $compile_id . '*.php'; |
|
152 | - $count=0; |
|
153 | - $files = glob($this->getCompileDir() . '/' . $glob); |
|
151 | + $glob = $compile_id.'*.php'; |
|
152 | + $count = 0; |
|
153 | + $files = glob($this->getCompileDir().'/'.$glob); |
|
154 | 154 | foreach ($files as $filename) { |
155 | 155 | $count += unlink($filename) ? 1 : 0; |
156 | 156 | } |
157 | - $files = glob($this->getCacheDir() . '/*' . $glob); |
|
157 | + $files = glob($this->getCacheDir().'/*'.$glob); |
|
158 | 158 | foreach ($files as $filename) { |
159 | 159 | $count += unlink($filename) ? 1 : 0; |
160 | 160 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | // allow [[foo]] syntax for escaping a tag |
175 | 175 | if ($tag[1] === '[' && $tag[6] === ']') { |
176 | 176 | //return substr($tag[0], 1, -1); |
177 | - return '[' . substr($tag[0], 2, -2) . ']'; |
|
177 | + return '['.substr($tag[0], 2, -2).']'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $tagName = $tag[2]; |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | |
183 | 183 | if (isset($tag[5])) { |
184 | 184 | // enclosing tag - extra parameter |
185 | - return $tag[1] . call_user_func($this->shortcodes[$tagName], $attr, $tag[5], $tagName) . $tag[6]; |
|
185 | + return $tag[1].call_user_func($this->shortcodes[$tagName], $attr, $tag[5], $tagName).$tag[6]; |
|
186 | 186 | } else { |
187 | 187 | // self-closing tag |
188 | - return $tag[1] . call_user_func($this->shortcodes[$tagName], $attr, null, $tagName) . $tag[6]; |
|
188 | + return $tag[1].call_user_func($this->shortcodes[$tagName], $attr, null, $tagName).$tag[6]; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | return substr($tag[0], 1, -1); |
272 | 272 | } |
273 | 273 | |
274 | - return $tag[1] . $tag[6]; |
|
274 | + return $tag[1].$tag[6]; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |