From: Nicolas Boisselier Date: Mon, 18 Nov 2024 23:35:39 +0000 (+0100) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=422a8facd9c661b361c0bd5386a90a36bfeb3b70;p=nb.git www/dbq/dbq.php --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 18ea6662..933a3ef4 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -1325,13 +1325,15 @@ EOF; $lines = explode("\n",$phpinfo); - $section = 'Root'; + $section = ''; + $sub = ''; $rows = []; while (true) { $line = next($lines); if ($line === false) break; + // Section if (strpos($line, '_______') === 1) { #bye($line); $section = ''; @@ -1343,15 +1345,31 @@ EOF; continue; } + // Sub + if (substr(trim($line), -1) !== ',' and !strpos($line, '=>')) { + $sub = $line; + continue; + } + + // Key => Val if (preg_match('/(.*) => (.*)/',$line,$m)) { $rows[] = [ 'section' => $section, + 'sub' => $sub, 'key' => $m[1], 'val' => $m[2], ]; } - #substr(trim($line_buffer), -1) === ',' + // Vals multi lines + while (substr(trim($line), -1) === ',') { + $line = next($lines); + if ($line === false) break; + #bye($line); + #$row = end($rows); + $idx = key($rows); + $rows[$idx]['val'] .= ' '.$line; + } } $this->page($rows);