static function shutdown() { if (self::$query_log) { uasort(self::$query_log, function ($a, $b) { return $b[0] < $a[0] ? -1 : $b[0] > $a[0]; }); $self = Navigation::self(); $i = 1; $n = count(self::$query_log); foreach (self::$query_log as $where => $what) { $a = [$what[0], $what[1], $what[2], $where]; error_log("query_log: {$self} #{$i}/{$n}: " . json_encode($a)); ++$i; } } self::$query_log = false; }