Property | Type | Description | |
---|---|---|---|
$attempts | Connection attempt timeout and data read timeout | ||
$connected | Show debug information | ||
$debug | |||
$delay | Connection attempt count | ||
$error_no | Variable for storing socket resource | ||
$error_str | Variable for storing connection error number, if any | ||
$port | Connection state | ||
$socket | Delay between connection attempts in seconds | ||
$ssl | Port to connect to (default 8729 for ssl) | ||
$timeout | Connect using SSL (must enable api-ssl in IP/Services) |
Method | Description | |
---|---|---|
__destruct ( ) : void | Standard destructor | |
arrayChangeKeyName ( array &$array ) : array | Change "-" and "/" from array key to "_" | |
comm ( string $com, array $arr = [] ) : array | Write (send) data to Router OS | |
connect ( string $ip, string $login, string $password ) : boolean | Login to RouterOS | |
debug ( string $text ) : void | Print text for debug purposes | |
disconnect ( ) : void | Disconnect from RouterOS | |
encodeLength ( string $length ) : void | ||
isIterable ( $var ) | * Check, can be var used in foreach | |
parseResponse ( array $response ) : array | Parse response from Router OS | |
parseResponse4Smarty ( array $response ) : array | Parse response from Router OS | |
read ( boolean $parse = true ) : array | Read data from Router OS | |
write ( string $command, mixed $param2 = true ) : boolean | Write (send) data to Router OS |
public arrayChangeKeyName ( array &$array ) : array | ||
$array | array | Input array |
return | array | Array with changed key names |
public encodeLength ( string $length ) : void | ||
$length | string | |
return | void |
public parseResponse ( array $response ) : array | ||
$response | array | Response data |
return | array | Array with parsed data |
public parseResponse4Smarty ( array $response ) : array | ||
$response | array | Response data |
return | array | Array with parsed data |
public write ( string $command, mixed $param2 = true ) : boolean | ||
$command | string | A string with the command to send |
$param2 | mixed | If we set an integer, the command will send this data as a "tag" If we set it to boolean true, the funcion will send the comand and finish If we set it to boolean false, the funcion will send the comand and wait for next command Default: true |
return | boolean | Return false if no command especified |
public $error_str |