API Index — Namespaces, Packages, Reports, Indices
PhpInfo
in package
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).
Tags
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
- anchor() : string
- Invisible in-page anchor target for the TOC; placed BEFORE a section's <h2>.
- collectEnv() : array<int|string, mixed>
- collectRequestVars() : array<string, array<int|string, mixed>>
- document() : string
- e() : string
- iniField() : string
- openswooleVersion() : string
- renderConfiguration() : string
- renderEnvironment() : string
- Process environment table (
$_ENV/getenv()). In coroutine/CLI context this may be sparse — that's fine; an empty bag yields a "(no variables)" row rather than a missing section, so the TOC link always resolves. -
renderExtensionConfiguration()
: array{0: string, 1: list
} - Apache "per-module configuration" detail: one 3-column table per loaded extension that actually exposes ini directives. Mirrors the big stack of per-extension sections in classic phpinfo().
- renderGeneral() : string
- renderModules() : string
- renderSystem() : string
- Apache+mod_php "System" table — the canonical top-of-phpinfo build/config block. Every probe is guarded: a diagnostics page must never fatal, so each value degrades to '—' rather than throwing.
- renderToc() : string
- Sticky horizontal pill nav linking to each rendered section. The anchor targets are emitted by anchor() just before each section's <h2>, so the existing exact-header assertions on the <h2> tags stay untouched.
- renderVariables() : string
- safe() : string
- Run a guarded probe, degrading to '—' on any failure so the diagnostics page can never fatal regardless of SAPI/extension state.
- section() : string
- slug() : string
- Stable, URL-safe id for a section title (used by both the TOC link and its anchor).
- 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 nativephpinfo()). - $requestVars : array<string, array<int|string, mixed>>|null = null
-
Test seam:
['_GET'=>..., '_POST'=>..., '_COOKIE'=>..., '_SERVER'=>...]. Null pulls fromG.
Return values
stringanchor()
Invisible in-page anchor target for the TOC; placed BEFORE a section's <h2>.
private
static anchor(string $title) : string
Parameters
- $title : string
Return values
stringcollectEnv()
private
static collectEnv() : array<int|string, mixed>
Return values
array<int|string, mixed>collectRequestVars()
private
static collectRequestVars() : array<string, array<int|string, mixed>>
Return values
array<string, array<int|string, mixed>>document()
private
static document(string $body[, array<int, string> $toc = [] ]) : string
Parameters
- $body : string
- $toc : array<int, string> = []
-
Section titles to surface in the in-page nav (already-rendered sections only).
Return values
stringe()
private
static e(string $s) : string
Parameters
- $s : string
Return values
stringiniField()
private
static iniField(array<string|int, mixed> $info, string $key) : string
Parameters
- $info : array<string|int, mixed>
- $key : string
Return values
stringopenswooleVersion()
private
static openswooleVersion() : string
Return values
stringrenderConfiguration()
private
static renderConfiguration() : string
Return values
stringrenderEnvironment()
Process environment table ($_ENV / getenv()). In coroutine/CLI context
this may be sparse — that's fine; an empty bag yields a "(no variables)" row
rather than a missing section, so the TOC link always resolves.
private
static renderEnvironment() : string
Return values
stringrenderExtensionConfiguration()
Apache "per-module configuration" detail: one 3-column table per loaded extension that actually exposes ini directives. Mirrors the big stack of per-extension sections in classic phpinfo().
private
static renderExtensionConfiguration() : array{0: string, 1: list}
Reserved-string contract: section titles are the extension NAME only — they must never contain "Loaded Extensions" or "PHP Variables", which the flag-selectivity tests assert are absent under INFO_CONFIGURATION.
Return values
array{0: string, 1: list[html, toc-titles]
renderGeneral()
private
static renderGeneral() : string
Return values
stringrenderModules()
private
static renderModules() : string
Return values
stringrenderSystem()
Apache+mod_php "System" table — the canonical top-of-phpinfo build/config block. Every probe is guarded: a diagnostics page must never fatal, so each value degrades to '—' rather than throwing.
private
static renderSystem() : string
Return values
stringrenderToc()
Sticky horizontal pill nav linking to each rendered section. The anchor targets are emitted by anchor() just before each section's <h2>, so the existing exact-header assertions on the <h2> tags stay untouched.
private
static renderToc(array<int, string> $toc) : string
Parameters
- $toc : array<int, string>
Return values
stringrenderVariables()
private
static renderVariables(array<string, array<int|string, mixed>> $vars) : string
Parameters
- $vars : array<string, array<int|string, mixed>>
Return values
stringsafe()
Run a guarded probe, degrading to '—' on any failure so the diagnostics page can never fatal regardless of SAPI/extension state.
private
static safe(callable(): string $probe) : string
Parameters
- $probe : callable(): string
Return values
stringsection()
private
static section(string $title, array<string, string> $rows) : string
Parameters
- $title : string
- $rows : array<string, string>
Return values
stringslug()
Stable, URL-safe id for a section title (used by both the TOC link and its anchor).
private
static slug(string $title) : string
Parameters
- $title : string
Return values
stringstringify()
private
static stringify(mixed $v) : string
Parameters
- $v : mixed
Return values
stringstyles()
private
static styles() : string
Return values
stringtoArray()
private
static toArray(mixed $v) : array<int|string, mixed>
Parameters
- $v : mixed