PEAR2_Net_RouterOS  1.0.0b6
A MikroTik RouterOS client
Registry Class Reference

Public Member Functions

 __construct ($uri)
 Creates a registry. More...
 
 isTaglessModeOwner ()
 Checks if this instance is the tagless mode owner. More...
 
 setTaglessMode ($taglessMode)
 Sets the "tagless mode" setting. More...
 
 getOwnershipTag ()
 Get the ownership tag for this instance. More...
 
 add (Response $response, $ownershipTag)
 Add a response to the registry. More...
 
 getNextResponse ()
 Gets the next response from this instance's buffer. More...
 
 close ()
 Closes the registry. More...
 
 __destruct ()
 Removes this instance's buffer.
 

Static Public Member Functions

static parseTag ($tag)
 Parses a tag. More...
 

Protected Attributes

 $shm
 
 $instanceId
 

Static Protected Attributes

static $requestId = -1
 
static $instanceIdSeed = -1
 

Detailed Description

Definition at line 43 of file Registry.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $uri)

Creates a registry.

Parameters
string$uriAn URI to bind the registry to.

Definition at line 78 of file Registry.php.

Member Function Documentation

◆ add()

add ( Response  $response,
  $ownershipTag 
)

Add a response to the registry.

Parameters
Response$responseThe response to add. The caller of this function is responsible for ensuring that the ownership tag and the original tag are separated, so that only the original one remains in the response.
string$ownershipTagThe ownership tag that the response had.
Returns
bool TRUE if the request was added to its buffer, FALSE if this instance owns the response, and therefore doesn't need to add the response to its buffer.

Definition at line 180 of file Registry.php.

◆ close()

close ( )

Closes the registry.

Closes the registry, meaning that all buffers are cleared.

Returns
void

Definition at line 260 of file Registry.php.

◆ getNextResponse()

getNextResponse ( )

Gets the next response from this instance's buffer.

Returns
Response|null The next response, or NULL if there isn't one.

Definition at line 236 of file Registry.php.

◆ getOwnershipTag()

getOwnershipTag ( )

Get the ownership tag for this instance.

Returns
string The ownership tag for this registry instance.

Definition at line 162 of file Registry.php.

◆ isTaglessModeOwner()

isTaglessModeOwner ( )

Checks if this instance is the tagless mode owner.

Returns
bool TRUE if this instance is the tagless mode owner, FALSE otherwise.

Definition at line 119 of file Registry.php.

◆ parseTag()

static parseTag (   $tag)
static

Parses a tag.

Parses a tag to reveal the ownership part of it, and the original tag.

Parameters
string$tagThe tag (as received) to parse.
Returns
array<int,string|null> An array with the first member being the ownership tag, and the second one being the original tag.

Definition at line 100 of file Registry.php.

◆ setTaglessMode()

setTaglessMode (   $taglessMode)

Sets the "tagless mode" setting.

While in tagless mode, this instance will claim ownership of any responses without a tag. While not in this mode, any requests without a tag will be given to all instances.

Regardless of mode, if the type of the response is Response::TYPE_FATAL, it will be given to all instances.

Parameters
bool$taglessModeTRUE to claim tagless ownership, FALSE to release such ownership, if taken.
Returns
bool TRUE on success, FALSE on failure.

Definition at line 143 of file Registry.php.


The documentation for this class was generated from the following file: