Context
in package
Class \Hoa\Stream\Context.
Make a multiton of stream contexts.
Tags
Table of Contents
Properties
- $_id : string
- Context ID.
- $_instances : array<string|int, mixed>
- Multiton.
Methods
- contextExists() : bool
- Check if a context exists.
- getContext() : resource
- Get context as a resource.
- getId() : string
- Get context ID.
- getInstance() : Context
- Multiton.
- getOptions() : array<string|int, mixed>
- Get options.
- getParameters() : array<string|int, mixed>
- Get parameters.
- setOptions() : bool
- Set options.
- setParameters() : bool
- Set parameters.
- __construct() : mixed
- Construct a context.
Properties
$_id
Context ID.
protected
string
$_id
= null
$_instances
Multiton.
protected
static array<string|int, mixed>
$_instances
= []
Methods
contextExists()
Check if a context exists.
public
static contextExists(string $id) : bool
Parameters
- $id : string
-
ID.
Return values
boolgetContext()
Get context as a resource.
public
getContext() : resource
Return values
resourcegetId()
Get context ID.
public
getId() : string
Return values
stringgetInstance()
Multiton.
public
static getInstance(string $id) : Context
Parameters
- $id : string
-
ID.
Tags
Return values
ContextgetOptions()
Get options.
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getParameters()
Get parameters.
public
getParameters() : array<string|int, mixed>
.
Return values
array<string|int, mixed>setOptions()
Set options.
public
setOptions(array<string|int, mixed> $options) : bool
Please, see http://php.net/context.
Parameters
- $options : array<string|int, mixed>
-
Options.
Return values
boolsetParameters()
Set parameters.
public
setParameters(array<string|int, mixed> $parameters) : bool
Please, see http://php.net/context.params.
Parameters
- $parameters : array<string|int, mixed>
-
Parameters.
Return values
bool__construct()
Construct a context.
protected
__construct(mixed $id) : mixed
Parameters
- $id : mixed