HelPHP

helPHP

Table of Contents

Packages

libs
utils
utilsphphomehelPHPutilsjob

Functions

helphp_ws_say()  : mixed
helphp_ws_fail()  : mixed
helphp_ws_config_value()  : array<string|int, mixed>
Reads a constant value out of a config file, without including it (the class may already be loaded with older values).
helphp_ws_config_ensure()  : int
Adds the constants a previous installer did not know, before the closing brace.
helphp_ws_send()  : void
Sends one masked text frame, as a browser does.
helphp_ws_read()  : array<string|int, mixed>|null
Reads one frame, answering pings on the way. Returns [opcode, payload].
helphp_ws_probe()  : int
End-to-end check: a real socket subscribes, a real publish is delivered.

Functions

helphp_ws_say()

helphp_ws_say(mixed $status, mixed $text) : mixed
Parameters
$status : mixed
$text : mixed

helphp_ws_fail()

helphp_ws_fail(mixed $text) : mixed
Parameters
$text : mixed

helphp_ws_config_value()

Reads a constant value out of a config file, without including it (the class may already be loaded with older values).

helphp_ws_config_value(string $file, string $name) : array<string|int, mixed>
Parameters
$file : string
$name : string
Return values
array<string|int, mixed> —

[found, raw value]

helphp_ws_config_ensure()

Adds the constants a previous installer did not know, before the closing brace.

helphp_ws_config_ensure(string $file, array<string, string> $lines) : int

Utils::write_in_config() replaces an existing const NAME = …; line but never creates one: an instance configured before IDLE_STOP existed would keep a config the runner reads with defaults, and the file would lie about it.

Parameters
$file : string

Config file.

$lines : array<string, string>

Constant name => value, already rendered.

Return values
int —

Number of lines added.

helphp_ws_send()

Sends one masked text frame, as a browser does.

helphp_ws_send(resource $socket, string $text) : void
Parameters
$socket : resource
$text : string

helphp_ws_read()

Reads one frame, answering pings on the way. Returns [opcode, payload].

helphp_ws_read(resource $socket) : array<string|int, mixed>|null
Parameters
$socket : resource
Return values
array<string|int, mixed>|null —

Null when the socket is closed or silent.

helphp_ws_probe()

End-to-end check: a real socket subscribes, a real publish is delivered.

helphp_ws_probe(string $instance) : int
Parameters
$instance : string
Return values
int —

0 when the chain works.

On this page

Search results