PHP 클래스 RouterosAPI, routeros-api

RouterOS PHP API class v1.6 Author: Denis Basta Contributors: Nick Barnes Ben Menking (ben [at] infotechsc [dot] com) Jeremy Jefferson (http://jeremyj.com) Cristian Deluxe (djcristiandeluxe [at] gmail [dot] com) Mikhail Moskalev (mmv.rus [at] gmail [dot] com) http://www.mikrotik.com http://wiki.mikrotik.com/wiki/API_PHP_class ****************************
파일 보기 프로젝트 열기: BenMenking/routeros-api 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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)

공개 메소드들

메소드 설명
__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

메소드 상세

__destruct() 공개 메소드

Standard destructor
public __destruct ( ) : void
리턴 void

arrayChangeKeyName() 공개 메소드

Change "-" and "/" from array key to "_"
public arrayChangeKeyName ( array &$array ) : array
$array array Input array
리턴 array Array with changed key names

comm() 공개 메소드

Write (send) data to Router OS
public comm ( string $com, array $arr = [] ) : array
$com string A string with the command to send
$arr array An array with arguments or queries
리턴 array Array with parsed

connect() 공개 메소드

Login to RouterOS
public connect ( string $ip, string $login, string $password ) : boolean
$ip string Hostname (IP or domain) of the RouterOS server
$login string The RouterOS username
$password string The RouterOS password
리턴 boolean If we are connected or not

debug() 공개 메소드

Print text for debug purposes
public debug ( string $text ) : void
$text string Text to print
리턴 void

disconnect() 공개 메소드

Disconnect from RouterOS
public disconnect ( ) : void
리턴 void

encodeLength() 공개 메소드

public encodeLength ( string $length ) : void
$length string
리턴 void

isIterable() 공개 메소드

* Check, can be var used in foreach
public isIterable ( $var )

parseResponse() 공개 메소드

Parse response from Router OS
public parseResponse ( array $response ) : array
$response array Response data
리턴 array Array with parsed data

parseResponse4Smarty() 공개 메소드

Parse response from Router OS
public parseResponse4Smarty ( array $response ) : array
$response array Response data
리턴 array Array with parsed data

read() 공개 메소드

Read data from Router OS
public read ( boolean $parse = true ) : array
$parse boolean Parse the data? default: true
리턴 array Array with parsed or unparsed data

write() 공개 메소드

Write (send) data to Router OS
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
리턴 boolean Return false if no command especified

프로퍼티 상세

$attempts 공개적으로 프로퍼티

Connection attempt timeout and data read timeout
public $attempts

$connected 공개적으로 프로퍼티

Show debug information
public $connected

$debug 공개적으로 프로퍼티

public $debug

$delay 공개적으로 프로퍼티

Connection attempt count
public $delay

$error_no 공개적으로 프로퍼티

Variable for storing socket resource
public $error_no

$error_str 공개적으로 프로퍼티

Variable for storing connection error number, if any
public $error_str

$port 공개적으로 프로퍼티

Connection state
public $port

$socket 공개적으로 프로퍼티

Delay between connection attempts in seconds
public $socket

$ssl 공개적으로 프로퍼티

Port to connect to (default 8729 for ssl)
public $ssl

$timeout 공개적으로 프로퍼티

Connect using SSL (must enable api-ssl in IP/Services)
public $timeout