Context
class Context
Constants
| FD |
|
Properties
| static protected array | $storage |
Methods
Set a value in the WebSocket context.
Get a value from the WebSocket context.
Determine if a value exists in the WebSocket context.
Remove a value from the WebSocket context.
Release all context data for a file descriptor.
Copy context data from another file descriptor into the current one.
Get a value from the context, or set and return a default.
Get the entire context storage.
Flush all static state.
Details
at line 20
static mixed
set(string $id, mixed $value)
Set a value in the WebSocket context.
at line 31
static mixed
get(string $id, mixed $default = null, int|null $fd = null)
Get a value from the WebSocket context.
at line 41
static bool
has(string $id, int|null $fd = null)
Determine if a value exists in the WebSocket context.
at line 52
static void
forget(string $id)
Remove a value from the WebSocket context.
at line 63
static void
release(int|null $fd = null)
Release all context data for a file descriptor.
at line 77
static void
copyFrom(int $fromFd, array $keys = [])
Copy context data from another file descriptor into the current one.
Merges into the current FD's context — existing values that are not in the source are preserved. Matching keys are overwritten.
at line 106
static mixed
override(string $id, Closure $closure)
Override a value in the WebSocket context using a callback.
at line 120
static mixed
getOrSet(string $id, mixed $value)
Get a value from the context, or set and return a default.
at line 131
static array
getStorage()
Get the entire context storage.
at line 139
static void
flushState()
Flush all static state.