]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Nov 2024 23:35:39 +0000 (00:35 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Nov 2024 23:35:39 +0000 (00:35 +0100)
www/dbq/dbq.php

index 18ea666292528f3161a38d3946a6323a72253b55..933a3ef4288996a118c7d0da9dbaca20fd8e5027 100644 (file)
@@ -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);