X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdbm.php;h=812989072b7232aacd7d5e0d10f0dd444ca25ef3;hb=fd3cf1cd02b57e9796e5537dbee468d1c8048a48;hp=3f936947d841b742139a2981a5a660ffc4b48b36;hpb=1dd77ee443f700c4f48e8b655ceef968b8fbb753;p=friendica.git diff --git a/include/dbm.php b/include/dbm.php index 3f936947d8..812989072b 100644 --- a/include/dbm.php +++ b/include/dbm.php @@ -20,8 +20,8 @@ class dbm { foreach ($r AS $process) { $state = trim($process["State"]); - // Filter out all idle processes - if (!in_array($state, array("", "init", "statistics"))) { + // Filter out all non blocking processes + if (!in_array($state, array("", "init", "statistics", "updating"))) { ++$states[$state]; ++$processes; } @@ -35,5 +35,19 @@ class dbm { } return(array("list" => $statelist, "amount" => $processes)); } + + /** + * Checks if $array is a filled array with at least one entry. + * + * @param $array mixed A filled array with at least one entry + * @return Whether $array is a filled array + */ + public static function is_result($array) { + // It could be a return value from an update statement + if (is_bool($array)) + return $array; + + return (is_array($array) && count($array) > 0); + } } ?>