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

IPC
in package

FinalYes

Length-prefixed JSON framing for the native FCGI-style worker pool.

Wire format (symmetric, parent <-> child): [4 bytes: uint32 big-endian length] [N bytes: JSON-encoded payload]

Sanity cap: 64 MB per frame — protects against runaway corrupted-length reads draining all memory.

Table of Contents

Constants

MAX_FRAME_BYTES  : mixed = 64 * 1024 * 1024
Hard ceiling on a single frame body size (bytes).

Methods

readFrame()  : array<string|int, mixed>|null
Read one length-prefixed JSON frame.
writeFrame()  : void
Write a length-prefixed JSON frame to an open stream.
readExact()  : string|null
Read exactly $n bytes from a stream with timeout.

Constants

MAX_FRAME_BYTES

Hard ceiling on a single frame body size (bytes).

public mixed MAX_FRAME_BYTES = 64 * 1024 * 1024

Methods

readFrame()

Read one length-prefixed JSON frame.

public static readFrame(resource $fp[, float $timeout = 30.0 ]) : array<string|int, mixed>|null
Parameters
$fp : resource

Readable stream.

$timeout : float = 30.0

Max seconds to wait (default 30).

Return values
array<string|int, mixed>|null

writeFrame()

Write a length-prefixed JSON frame to an open stream.

public static writeFrame(resource $fp, array<string|int, mixed> $payload) : void
Parameters
$fp : resource

Writable stream.

$payload : array<string|int, mixed>

readExact()

Read exactly $n bytes from a stream with timeout.

private static readExact(resource $fp, positive-int $n[, float $timeout = 30.0 ]) : string|null
Parameters
$fp : resource
$n : positive-int
$timeout : float = 30.0

Max seconds to wait.

Return values
string|null
On this page