Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

PhpInfo
in package

FinalYes

Renders phpinfo() as a self-contained HTML document, restoring Apache+mod_php parity for the CLI SAPI (which otherwise emits a plain-text key => value dump).

Pure renderer: no echo, no global writes. The uopz override target \ZealPHP\phpinfo() echoes render() and returns true.

Robustness: a diagnostics page must never fatal. Request-variable collection is guarded so render() works in any context (request handler, CLI, unit test).

Table of Contents

Properties

$moduleText  : string
Boot-captured native phpinfo(INFO_MODULES) text, primed once per worker.

Methods

primeModuleText()  : void
Store the native module-section text captured before the uopz override.
render()  : string
collectRequestVars()  : array<string, array<int|string, mixed>>
document()  : string
e()  : string
iniField()  : string
openswooleVersion()  : string
renderConfiguration()  : string
renderGeneral()  : string
renderModules()  : string
renderVariables()  : string
section()  : string
stringify()  : string
styles()  : string
toArray()  : array<int|string, mixed>

Properties

$moduleText

Boot-captured native phpinfo(INFO_MODULES) text, primed once per worker.

private static string $moduleText = ''

Methods

primeModuleText()

Store the native module-section text captured before the uopz override.

public static primeModuleText(string $text) : void
Parameters
$text : string

render()

public static render([int $flags = INFO_ALL ][, array<string, array<int|string, mixed>>|null $requestVars = null ]) : string
Parameters
$flags : int = INFO_ALL

INFO_* bitmask (matches native phpinfo()).

$requestVars : array<string, array<int|string, mixed>>|null = null

Test seam: ['_GET'=>..., '_POST'=>..., '_COOKIE'=>..., '_SERVER'=>...]. Null pulls from G.

Return values
string

collectRequestVars()

private static collectRequestVars() : array<string, array<int|string, mixed>>
Return values
array<string, array<int|string, mixed>>

document()

private static document(string $body) : string
Parameters
$body : string
Return values
string

e()

private static e(string $s) : string
Parameters
$s : string
Return values
string

iniField()

private static iniField(array<string|int, mixed> $info, string $key) : string
Parameters
$info : array<string|int, mixed>
$key : string
Return values
string

openswooleVersion()

private static openswooleVersion() : string
Return values
string

renderConfiguration()

private static renderConfiguration() : string
Return values
string

renderGeneral()

private static renderGeneral() : string
Return values
string

renderModules()

private static renderModules() : string
Return values
string

renderVariables()

private static renderVariables(array<string, array<int|string, mixed>> $vars) : string
Parameters
$vars : array<string, array<int|string, mixed>>
Return values
string

section()

private static section(string $title, array<string, string> $rows) : string
Parameters
$title : string
$rows : array<string, string>
Return values
string

stringify()

private static stringify(mixed $v) : string
Parameters
$v : mixed
Return values
string

styles()

private static styles() : string
Return values
string

toArray()

private static toArray(mixed $v) : array<int|string, mixed>
Parameters
$v : mixed
Return values
array<int|string, mixed>
On this page