Skip to content
PHP Ecosystem
Explore

PhpInfoDataNormalizer

API reference › Debug Core › PhpInfo › PhpInfoDataNormalizer

final classPHPForge\Debug\PhpInfo\PhpInfoDataNormalizer
Sourcesrc/PhpInfo/PhpInfoDataNormalizer.php

Narrows the raw phpinfo() HTML output into the typed PhpInfoView.

Splits the captured body into the overview chunk (everything before the first <h2>) and the modules chunk (every module heading + table that follows), parses each <tr><td>k</td><td>v</td></tr> pair into a key/value map, builds the five hero sections (‘PHP version’ / ‘Build’ / ‘Configuration’ / ‘Capabilities’ / ‘Streams’) with typed tiles, and wraps every module <table> in the panel’s table chrome plus a deep-link <section> so the search filter and the TOC can hide / jump to it.

MethodDescriptionDefined by
capture() staticCaptures the phpinfo() report of the current process and narrows it into the typed PhpInfoView.PhpInfoDataNormalizer
fromOutput() staticBuilds the typed view-model from the raw phpinfo() HTML body, the runtime metrics PHP itself reports (SAPI, OS, memory limit) and the active PHP_VERSION constant.PhpInfoDataNormalizer
public static function capture(): PHPForge\Debug\PhpInfo\PhpInfoView

Captures the phpinfo() report of the current process and narrows it into the typed PhpInfoView.

Returns

PhpInfoView: Typed view-model for the running PHP process.

public static function fromOutput(string $body, string $phpVersion, string $sapi, string $os, string $memoryLimit): PHPForge\Debug\PhpInfo\PhpInfoView

Builds the typed view-model from the raw phpinfo() HTML body, the runtime metrics PHP itself reports (SAPI, OS, memory limit) and the active PHP_VERSION constant.

Parameters

ParameterTypeDescription
$bodystringCaptured phpinfo() output, already narrowed to its <body> content.
$phpVersionstringRunning PHP version used as the hero headline.
$sapistringServer API name.
$osstringHost operating system description.
$memoryLimitstringEffective memory_limit directive.

Returns

PhpInfoView