PEAR2_Net_RouterOS
1.0.0b5
A MikroTik RouterOS client
|
Public Member Functions | |
__construct ($command, Query $query=null, $tag=null) | |
Creates a request to send to RouterOS. More... | |
__invoke ($arg=null) | |
A shorthand gateway. More... | |
setCommand ($command) | |
Sets the command to send to RouterOS. More... | |
getCommand () | |
Gets the command that will be send to RouterOS. More... | |
setQuery (Query $query=null) | |
Sets the query to send with the command. More... | |
getQuery () | |
Gets the currently associated query. More... | |
setTag ($tag) | |
Sets the tag to associate the request with. More... | |
setArgument ($name, $value= '') | |
Sets an argument for the request. More... | |
getArgument ($name) | |
Gets the value of an argument. More... | |
removeAllArguments () | |
Removes all arguments from the request. More... | |
send (Communicator $com, Registry $reg=null) | |
Sends a request over a communicator. More... | |
Protected Member Functions | |
parseArgumentString ($string) | |
Parses the arguments of a command. More... | |
Additional Inherited Members |
Definition at line 37 of file Request.php.
__construct | ( | $command, | |
Query | $query = null , |
||
$tag = null |
|||
) |
Creates a request to send to RouterOS.
string | $command | The command to send. Can also contain arguments expressed in a shell-like syntax. |
Query | $query | A query to associate with the request. |
string | $tag | The tag for the request. |
Definition at line 63 of file Request.php.
__invoke | ( | $arg = null | ) |
A shorthand gateway.
This is a magic PHP method that allows you to call the object as a function. Depending on the argument given, one of the other functions in the class is invoked and its returned value is returned by this function.
Query | Communicator | string | null | $arg | A Query to associate the request with, a Communicator to send the request over, an argument to get the value of, or NULL to get the tag. If a second argument is provided, this becomes the name of the argument to set the value of, and the second argument is the value to set. |
Definition at line 95 of file Request.php.
getArgument | ( | $name | ) |
Gets the value of an argument.
string | $name | The name of the argument. |
Definition at line 247 of file Request.php.
getCommand | ( | ) |
Gets the command that will be send to RouterOS.
Gets the command that will be send to RouterOS in its API syntax.
Definition at line 170 of file Request.php.
getQuery | ( | ) |
Gets the currently associated query.
Definition at line 196 of file Request.php.
|
protected |
Parses the arguments of a command.
string | $string | The argument string to parse. |
Definition at line 340 of file Request.php.
removeAllArguments | ( | ) |
Removes all arguments from the request.
Definition at line 257 of file Request.php.
send | ( | Communicator | $com, |
Registry | $reg = null |
||
) |
Sends a request over a communicator.
Communicator | $com | The communicator to send the request over. |
Registry | $reg | An optional registry to sync the request with. |
Definition at line 272 of file Request.php.
setArgument | ( | $name, | |
$value = '' |
|||
) |
Sets an argument for the request.
string | $name | Name of the argument. |
string | resource | null | $value | Value of the argument as a string or seekable stream. Setting the value to NULL removes an argument of this name. If a seekable stream is provided, it is sent from its current posistion to its end, and the pointer is seeked back to its current position after sending. Non seekable streams, as well as all other types, are casted to a string. |
Definition at line 233 of file Request.php.
setCommand | ( | $command | ) |
Sets the command to send to RouterOS.
Sets the command to send to RouterOS. The command can use the API or CLI syntax of RouterOS, but either way, it must be absolute (begin with a "/") and without arguments.
string | $command | The command to send. |
Definition at line 122 of file Request.php.
setQuery | ( | Query | $query = null | ) |
Sets the query to send with the command.
Query | $query | The query to be set. Setting NULL will remove the currently associated query. |
Definition at line 184 of file Request.php.
setTag | ( | $tag | ) |
Sets the tag to associate the request with.
Sets the tag to associate the request with. Setting NULL erases the currently set tag.
string | $tag | The tag to set. |
Definition at line 212 of file Request.php.