From 725d971be8dfb2870e01c0e52679b3b9dd277e97 Mon Sep 17 00:00:00 2001 From: Paul Rock Date: Fri, 24 Aug 2018 14:28:49 +0300 Subject: [PATCH] more examples added --- examples/export.php | 25 ++++++++++++++++++++++ ...m_packag_print.php => system_package_print.php} | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 examples/export.php rename examples/{system_packag_print.php => system_package_print.php} (87%) diff --git a/examples/export.php b/examples/export.php new file mode 100644 index 0000000..b084f9d --- /dev/null +++ b/examples/export.php @@ -0,0 +1,25 @@ +set('host', '192.168.1.3') + ->set('pass', 'admin') + ->set('user', 'admin'); + +// Initiate client with config object +$client = new Client($config); + +// Build query +$query = new Query('/export'); + +// Send query and read answer from RouterOS +$response = $client->write($query)->read(false); +print_r($response); diff --git a/examples/system_packag_print.php b/examples/system_package_print.php similarity index 87% rename from examples/system_packag_print.php rename to examples/system_package_print.php index 6200e3c..074679a 100644 --- a/examples/system_packag_print.php +++ b/examples/system_package_print.php @@ -18,11 +18,11 @@ $config = $client = new Client($config); // Build query -$query = new Query('/system/package/getall'); +$query = new Query('/system/package/print'); // Send query to RouterOS $request = $client->write($query); // Read answer from RouterOS -$response = $client->read2(); +$response = $client->read(); print_r($response);