Skip to content

Commit

Permalink
Added Util::comment();
Browse files Browse the repository at this point in the history
Added the GitHub wiki as a submodule;
Doc fixes.
  • Loading branch information
boenrobot committed Dec 24, 2014
1 parent 92eba52 commit e16038b
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/wiki"]
path = docs/wiki
url = https://github.com/pear2/Net_RouterOS.wiki.git
1 change: 1 addition & 0 deletions docs/wiki
Submodule wiki added at 2d18a4
19 changes: 10 additions & 9 deletions scripts/roscon.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@
1. You haven't enabled the API service at RouterOS or you've enabled it on a
different TCP port.
Make sure that the "api" service at "/ip service" is enabled, and with that
same TCP port (8728 by default or 8729 for "api-ssl").
Make sure the "api" service at the "/ip service" menu is enabled,
and with that same TCP port (8728 by default or 8729 for "api-ssl").
2. You've mistyped the IP and/or port.
Check the IP and port you've specified are the ones you intended.
3. Your web server's IP is not in the list of subnets allowed to use the API.
Check the "address" property at "/ip service".
Check the "address" property at the "/ip service" menu.
If it's empty, that's not the problem for sure. If it's non-empty however,
make sure your IP is in that list, or is at least matched as part of an
otherwise larger subnet.
Expand All @@ -301,10 +301,10 @@
service on.
6. The router has a firewall filter/mangle/nat rule that overrides the settings
at "/ip service".
at the "/ip service" menu.
Usually, those are rules in the "input" chain.
Theoretically, rules in the "prerouting" and/or "output" chains can also
have such an effect.
Theoretically, rules in the "prerouting", "dstnat", "output" and/or
"postrouting" chains can also cause such an effect.
By default, RouterBOARD devices have a filter rule in the "input" chain that
drops any incoming connections to the router from its WAN interface, so if
your web server is not in the LAN, the connection may be dropped because of
Expand Down Expand Up @@ -344,9 +344,10 @@
Check the permissions of the user's group at "/user group".
3. The user is not allowed to access the router from your web server's IP.
Make sure your web server's IP address is within the subnets the user is
allowed to log in from. You can check them at the "address" property
of the user in the "/user" menu.
Check the "address" property at the "/user" menu.
If it's empty, that's not the problem for sure. If it's non-empty however,
make sure your IP is in that list, or is at least matched as part of an
otherwise larger subnet.
4. Mistyped password.
Make sure you have spelled it correctly.
Expand Down
33 changes: 18 additions & 15 deletions src/PEAR2/Net/RouterOS/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ class Client
protected $pendingRequestsCount = 0;

/**
* @var array An array of responses that have not yet been extracted or
* passed to a callback. Key is the tag of the request, and the value
* is an array of associated responses.
* @var array<string,Response> An array of responses that have not yet been
* extracted or passed to a callback. Key is the tag of the request,
* and the value is an array of associated responses.
*/
protected $responseBuffer = array();

/**
* @var array An array of callbacks to be executed as responses come.
* @var array<string,callback> An array of callbacks to be executed
* as responses come.
* Key is the tag of the request, and the value is the callback for it.
*/
protected $callbacks = array();
Expand Down Expand Up @@ -438,8 +439,8 @@ public function sendSync(Request $request)
* Starts an event loop for the RouterOS callbacks and finishes when a
* specified request is completed.
*
* @param string $tag The tag of the request to complete. Setting NULL
* completes all requests.
* @param string|null $tag The tag of the request to complete.
* Setting NULL completes all requests.
*
* @return ResponseCollection A collection of {@link Response} objects that
* haven't been passed to a callback function or previously extracted
Expand Down Expand Up @@ -482,7 +483,8 @@ public function completeRequest($tag = null)
* Gets all new responses for a request that haven't been passed to a
* callback and clears the buffer from them.
*
* @param string $tag The tag of the request to extract new responses for.
* @param string|null $tag The tag of the request to extract
* new responses for.
* Specifying NULL with extract new responses for all requests.
*
* @return ResponseCollection A collection of {@link Response} objects for
Expand Down Expand Up @@ -527,9 +529,9 @@ public function extractNewResponses($tag = null)
* are no more pending requests or when a specified timeout has passed
* (whichever comes first).
*
* @param int $sTimeout Timeout for the loop. If NULL, there is no time
* limit.
* @param int $usTimeout Microseconds to add to the time limit.
* @param int|null $sTimeout Timeout for the loop.
* If NULL, there is no time limit.
* @param int $usTimeout Microseconds to add to the time limit.
*
* @return bool TRUE when there are any more pending requests, FALSE
* otherwise.
Expand Down Expand Up @@ -598,8 +600,8 @@ public function getPendingRequestsCount()
* removes any responses for it that were not previously extracted with
* {@link static::extractNewResponses()}.
*
* @param string $tag Tag of the request to cancel. Setting NULL will cancel
* all requests.
* @param string|null $tag Tag of the request to cancel.
* Setting NULL will cancel all requests.
*
* @return $this The client object.
* @see sendAsync()
Expand Down Expand Up @@ -775,9 +777,10 @@ protected function send(Request $request)
* Dispatches the next response in queue, i.e. it executes the associated
* callback if there is one, or places the response in the response buffer.
*
* @param int $sTimeout If a response is not immediately available, wait
* this many seconds. If NULL, wait indefinitely.
* @param int $usTimeout Microseconds to add to the waiting time.
* @param int|null $sTimeout If a response is not immediately available,
* wait this many seconds.
* If NULL, wait indefinitely.
* @param int $usTimeout Microseconds to add to the waiting time.
*
* @throws SocketException When there's no response within the time limit.
* @return Response The dispatched response.
Expand Down
Loading

0 comments on commit e16038b

Please sign in to comment.