Response.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
RouterOS API client implementation.
RouterOS is the flag product of the company MikroTik and is a powerful router software. One of its many abilities is to allow control over it via an API. This package provides a client for that API, in turn allowing you to use PHP to control RouterOS hosts. PHP version 5
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\Response

Package: PEAR2_Net_RouterOS
Represents a RouterOS response.
Parent(s)
\PEAR2\Net\RouterOS\Message
Author
Vasil Rangelov  
Category
Net  
License
LGPL License 2.1  
Link
http://pear2.php.net/PEAR2_Net_RouterOS  

Constants

>VConstant  TYPE_FINAL = '!done'
The last response for a request.
>VConstant  TYPE_DATA = '!re'
A response with data.
>VConstant  TYPE_ERROR = '!trap'
A response signifying error.
>VConstant  TYPE_FATAL = '!fatal'
A response signifying a fatal error, due to which the connection would be terminated.

Properties

>VPropertyprivatestring $_type

The response type.

Details
Type
string
>VPropertyprotectedarray $unrecognizedWords = array()

An array of unrecognized words in network order.

Default valuearray()Details
Type
array

Methods

methodpublic__construct(\PEAR2\Net\RouterOS\Communicator $com, bool $asStream = false, int $timeout_s = 0, int $timeout_us = null, \PEAR2\Net\RouterOS\Registry $reg = null) : void

Extracts a new response from a communicator.

Parameters
NameTypeDescription
$com\PEAR2\Net\RouterOS\Communicator

The communicator from which to extract the new response.

$asStreambool

Whether to populate the argument values with streams instead of strings.

$timeout_sint

If a response is not immediatly available, wait this many seconds. If NULL, wait indefinetly.

$timeout_usint

Microseconds to add to the waiting time.

$reg\PEAR2\Net\RouterOS\Registry

An optional registry to sync the response with.

Details
See
 
See
 
methodprivate_receive(\PEAR2\Net\RouterOS\Communicator $com, bool $asStream = false, int $timeout_s = 0, int $timeout_us = null) : void

Extracts a new response from a communicator.

This is the function that performs the actual receiving, while the constructor is also involved in locks and registry sync.
Parameters
NameTypeDescription
$com\PEAR2\Net\RouterOS\Communicator

The communicator from which to extract the new response.

$asStreambool

Whether to populate the argument values with streams instead of strings.

$timeout_sint

If a response is not immediatly available, wait this many seconds. If NULL, wait indefinetly.

$timeout_usint

Microseconds to add to the waiting time.

methodpublicgetType() : string

Gets the response type.

Returns
TypeDescription
stringThe response type.
Details
See
 
methodpublicgetUnrecognizedWords() : array

Gets a list of unrecognized words.

Returns
TypeDescription
arrayThe list of unrecognized words.
methodprotectedsetType(string $type) : \PEAR2\Net\RouterOS\Response | \PEAR2\Net\RouterOS\Response

Sets the response type.

Sets the response type. Valid values are the TYPE_* constants.
Parameters
NameTypeDescription
$typestring

The new response type.

Returns
TypeDescription
\PEAR2\Net\RouterOS\Response | \PEAR2\Net\RouterOS\ResponseThe response object.
Details
Fluent
This method is part of a fluent interface and will return the same instance  
See
 
Documentation was generated by phpDocumentor 2.1.0-DEV .