Registry.php
- Author
- Vasil Rangelov
- Category
- Net
- Copyright
- 2011 Vasil Rangelov
- License
- LGPL License 2.1
- Link
- http://pear2.php.net/PEAR2_Net_RouterOS
- Package
- PEAR2_Net_RouterOS
- Version
- 1.0.0b4
\PEAR2\Net\RouterOS\Registry
- Author
- Vasil Rangelov
- Category
- Net
- License
- LGPL License 2.1
- Link
- http://pear2.php.net/PEAR2_Net_RouterOS
Properties


int $instanceIdSeed = -1
ID to be given to next instance, after incrementing it.
-1
Details- Type
- int


int $requestId = -1
ID of request. Populated at first instance in request.
-1
Details- Type
- int
Methods


__construct(string $uri) : void
Creates a registry.
Name | Type | Description |
---|---|---|
$uri | string | An URI to bind the registry to. |


_add(\PEAR2\Net\RouterOS\Response $response, string $targetBufferName) : void
Adds a response to a buffer.
Name | Type | Description |
---|---|---|
$response | \PEAR2\Net\RouterOS\Response | The response to add. |
$targetBufferName | string | The name of the buffer to add the response to. |


_close(string $targetBufferName) : void
Removes a buffer.
Name | Type | Description |
---|---|---|
$targetBufferName | string | The buffer to remove. |


add(\PEAR2\Net\RouterOS\Response $response, string $ownershipTag) : bool
Add a response to the registry.
Name | Type | Description |
---|---|---|
$response | \PEAR2\Net\RouterOS\Response | The 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. |
$ownershipTag | string | The ownership tag that the response had. |
Type | Description |
---|---|
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. |


getNextResponse() : \PEAR2\Net\RouterOS\Response | null
Gets the next response from this instance's buffer.
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Response | null | The next response, or NULL if there isn't one. |


getOwnershipTag() : string
Get the ownership tag for this instance.
Type | Description |
---|---|
string | The ownership tag for this registry instance. |


isTaglessModeOwner() : bool
Checks if this instance is the tagless mode owner.
Type | Description |
---|---|
bool | TRUE if this instance is the tagless mode owner, FALSE otherwise. |


parseTag(string $tag) : array
Parses a tag.
Name | Type | Description |
---|---|---|
$tag | string | The tag (as received) to parse. |
Type | Description |
---|---|
array | An array with the first member being the ownership tag, and the second one being the original tag. |


setTaglessMode(bool $taglessMode) : bool
Sets the "tagless mode" setting.
Name | Type | Description |
---|---|---|
$taglessMode | bool | TRUE to claim tagless ownership, FALSE to release such ownership, if taken. |
Type | Description |
---|---|
bool | TRUE on success, FALSE on failure. |