diff options
author | Helmut K. C. Tessarek <tessarek@evermeet.cx> | 2019-11-25 22:46:35 +0300 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2019-11-25 22:46:35 +0300 |
commit | 8c7bfcfe7a7bee5e2a0ede68eb95d29450682d93 (patch) | |
tree | 464695668fd27d92a81fd712cf6dd4503c6561c7 | |
parent | c291de34a179faefa84ea53bee89176a5d380817 (diff) |
minor changes (#156)
* change order of evaluation
PHP evaluates conditions from left to right
count needs more instructions thus should be on the right side
(probably not necessary, but I'm a perf guy...)
* set a default in case it is not set in confg (to avoid PHP warnings)
-rw-r--r-- | includes/common.inc.php | 4 | ||||
-rw-r--r-- | index.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/includes/common.inc.php b/includes/common.inc.php index c50a2f3..ca63814 100644 --- a/includes/common.inc.php +++ b/includes/common.inc.php @@ -115,6 +115,10 @@ if (!isset($config['hideEmptyDBs'])) { $config['hideEmptyDBs'] = false; } +if (!isset($config['showEmptyNamespaceAsKey'])) { + $config['showEmptyNamespaceAsKey'] = false; +} + // Setup a connection to Redis. if(isset($server['scheme']) && $server['scheme'] === 'unix' && $server['path']) { $redis = new Predis\Client(array('scheme' => 'unix', 'path' => $server['path'])); @@ -34,7 +34,7 @@ if($redis) { } $key = explode($server['seperator'], $key); - if ($key[count($key) - 1] == '' && $config['showEmptyNamespaceAsKey']) { + if ($config['showEmptyNamespaceAsKey'] && $key[count($key) - 1] == '') { array_pop($key); $key[count($key) - 1] .= ':'; } |