From 422a8facd9c661b361c0bd5386a90a36bfeb3b70 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 19 Nov 2024 00:35:39 +0100 Subject: [PATCH] www/dbq/dbq.php --- www/dbq/dbq.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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); -- 2.47.3