diff --git a/README.md b/README.md index 9facdd4..7fb5bae 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ innovations to ease development. In addition, the project is designed to work with PHP7 in accordance with the PSR standards. You can use this library with pre-6.43 and post-6.43 versions of -RouterOS firmware, for switching you just need set `legacy` -parameter of config to required state (`false` by default). +RouterOS firmware, it will be detected automatically on connection stage. ## How to use @@ -41,11 +40,18 @@ $client = new Client([ 'pass' => 'admin' ]); -// Build query -$query = new Query('/ip/address/print'); +// Send query to RouterOS without parameters +$request = $client->write('/ip/address/print'); // or $client->write(['/ip/address/print']); -// Send query to RouterOS -$request = $client->write($query); +// Read answer from RouterOS +$response = $client->read(); +var_dump($response); + +// Send query to RouterOS with parameters +$request = $client->write([ + '/queue/simple/print', + '?target=192.168.1.1/32' +]); // Read answer from RouterOS $response = $client->read(); @@ -136,9 +142,9 @@ $client = new Client([ | Parameter | Type | Default | Description | |-----------|--------|---------|-------------| -| host | string | | Address of Mikrotik RouterOS | -| user | string | | Username | -| pass | string | | Password | +| host | string | | (required) Address of Mikrotik RouterOS | +| user | string | | (required) Username | +| pass | string | | (required) Password | | port | int | | RouterOS API port number for access (if not set use 8728 or 8729 if SSL enabled) | | ssl | bool | false | Enable ssl support (if port is not set this parameter must change default port to ssl port) | | legacy | bool | false | Support of legacy login scheme (true - pre 6.43, false - post 6.43) | @@ -148,6 +154,8 @@ $client = new Client([ ### How to enable support of legacy login schema (RouterOS pre-6.43) +> From 0.8.1 this is not important, version of firmware will be detected automatically. + ```php