]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/TraitMemcacheCommand.php
Merge pull request #7670 from nupplaphil/task/add_router_config
[friendica.git] / src / Core / Cache / TraitMemcacheCommand.php
index 2b136621e59aac084f59fb092f12766bd2bc1f29..0bbab79b254c290d973f6603ad7c7c7b20be2ad5 100644 (file)
@@ -44,16 +44,14 @@ trait TraitMemcacheCommand
 
                foreach ($lines as $line) {
 
-                       if (preg_match("/STAT items:([\d]+):number ([\d]+)/", $line, $matches)) {
-
-                               if (isset($matches[1])) {
-                                       if (!in_array($matches[1], $keys)) {
-                                               $slabs[] = $matches[1];
-                                               $string  = $this->sendMemcacheCommand("stats cachedump " . $matches[1] . " " . $matches[2]);
-                                               preg_match_all("/ITEM (.*?) /", $string, $matches);
-                                               $keys = array_merge($keys, $matches[1]);
-                                       }
-                               }
+                       if (preg_match("/STAT items:([\d]+):number ([\d]+)/", $line, $matches) &&
+                           isset($matches[1]) &&
+                           !in_array($matches[1], $keys)) {
+
+                               $slabs[] = $matches[1];
+                               $string  = $this->sendMemcacheCommand("stats cachedump " . $matches[1] . " " . $matches[2]);
+                               preg_match_all("/ITEM (.*?) /", $string, $matches);
+                               $keys = array_merge($keys, $matches[1]);
                        }
                }
 
@@ -83,7 +81,7 @@ trait TraitMemcacheCommand
                fwrite($s, $command . "\r\n");
                $buf = '';
 
-               while ((!feof($s))) {
+               while (!feof($s)) {
 
                        $buf .= fgets($s, 256);