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 = -1ID to be given to next instance, after incrementing it.
-1Details- Type
- int

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

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

_add(\PEAR2\Net\RouterOS\Response $response, string $targetBufferName) : voidAdds 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) : voidRemoves a buffer.
| Name | Type | Description |
|---|---|---|
| $targetBufferName | string | The buffer to remove. |

add(\PEAR2\Net\RouterOS\Response $response, string $ownershipTag) : boolAdd 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 | nullGets 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() : stringGet the ownership tag for this instance.
| Type | Description |
|---|---|
| string | The ownership tag for this registry instance. |

isTaglessModeOwner() : boolChecks 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) : arrayParses 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) : boolSets 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. |