Skip to content

Commit e16038b

Browse files
committed
Added Util::comment();
Added the GitHub wiki as a submodule; Doc fixes.
1 parent 92eba52 commit e16038b

File tree

5 files changed

+151
-90
lines changed

5 files changed

+151
-90
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "docs/wiki"]
2+
path = docs/wiki
3+
url = https://github.com/pear2/Net_RouterOS.wiki.git

docs/wiki

Submodule wiki added at 2d18a4c

scripts/roscon.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@
272272
273273
1. You haven't enabled the API service at RouterOS or you've enabled it on a
274274
different TCP port.
275-
Make sure that the "api" service at "/ip service" is enabled, and with that
276-
same TCP port (8728 by default or 8729 for "api-ssl").
275+
Make sure the "api" service at the "/ip service" menu is enabled,
276+
and with that same TCP port (8728 by default or 8729 for "api-ssl").
277277
278278
2. You've mistyped the IP and/or port.
279279
Check the IP and port you've specified are the ones you intended.
280280
281281
3. Your web server's IP is not in the list of subnets allowed to use the API.
282-
Check the "address" property at "/ip service".
282+
Check the "address" property at the "/ip service" menu.
283283
If it's empty, that's not the problem for sure. If it's non-empty however,
284284
make sure your IP is in that list, or is at least matched as part of an
285285
otherwise larger subnet.
@@ -301,10 +301,10 @@
301301
service on.
302302
303303
6. The router has a firewall filter/mangle/nat rule that overrides the settings
304-
at "/ip service".
304+
at the "/ip service" menu.
305305
Usually, those are rules in the "input" chain.
306-
Theoretically, rules in the "prerouting" and/or "output" chains can also
307-
have such an effect.
306+
Theoretically, rules in the "prerouting", "dstnat", "output" and/or
307+
"postrouting" chains can also cause such an effect.
308308
By default, RouterBOARD devices have a filter rule in the "input" chain that
309309
drops any incoming connections to the router from its WAN interface, so if
310310
your web server is not in the LAN, the connection may be dropped because of
@@ -344,9 +344,10 @@
344344
Check the permissions of the user's group at "/user group".
345345
346346
3. The user is not allowed to access the router from your web server's IP.
347-
Make sure your web server's IP address is within the subnets the user is
348-
allowed to log in from. You can check them at the "address" property
349-
of the user in the "/user" menu.
347+
Check the "address" property at the "/user" menu.
348+
If it's empty, that's not the problem for sure. If it's non-empty however,
349+
make sure your IP is in that list, or is at least matched as part of an
350+
otherwise larger subnet.
350351
351352
4. Mistyped password.
352353
Make sure you have spelled it correctly.

src/PEAR2/Net/RouterOS/Client.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ class Client
7474
protected $pendingRequestsCount = 0;
7575

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

8383
/**
84-
* @var array An array of callbacks to be executed as responses come.
84+
* @var array<string,callback> An array of callbacks to be executed
85+
* as responses come.
8586
* Key is the tag of the request, and the value is the callback for it.
8687
*/
8788
protected $callbacks = array();
@@ -438,8 +439,8 @@ public function sendSync(Request $request)
438439
* Starts an event loop for the RouterOS callbacks and finishes when a
439440
* specified request is completed.
440441
*
441-
* @param string $tag The tag of the request to complete. Setting NULL
442-
* completes all requests.
442+
* @param string|null $tag The tag of the request to complete.
443+
* Setting NULL completes all requests.
443444
*
444445
* @return ResponseCollection A collection of {@link Response} objects that
445446
* haven't been passed to a callback function or previously extracted
@@ -482,7 +483,8 @@ public function completeRequest($tag = null)
482483
* Gets all new responses for a request that haven't been passed to a
483484
* callback and clears the buffer from them.
484485
*
485-
* @param string $tag The tag of the request to extract new responses for.
486+
* @param string|null $tag The tag of the request to extract
487+
* new responses for.
486488
* Specifying NULL with extract new responses for all requests.
487489
*
488490
* @return ResponseCollection A collection of {@link Response} objects for
@@ -527,9 +529,9 @@ public function extractNewResponses($tag = null)
527529
* are no more pending requests or when a specified timeout has passed
528530
* (whichever comes first).
529531
*
530-
* @param int $sTimeout Timeout for the loop. If NULL, there is no time
531-
* limit.
532-
* @param int $usTimeout Microseconds to add to the time limit.
532+
* @param int|null $sTimeout Timeout for the loop.
533+
* If NULL, there is no time limit.
534+
* @param int $usTimeout Microseconds to add to the time limit.
533535
*
534536
* @return bool TRUE when there are any more pending requests, FALSE
535537
* otherwise.
@@ -598,8 +600,8 @@ public function getPendingRequestsCount()
598600
* removes any responses for it that were not previously extracted with
599601
* {@link static::extractNewResponses()}.
600602
*
601-
* @param string $tag Tag of the request to cancel. Setting NULL will cancel
602-
* all requests.
603+
* @param string|null $tag Tag of the request to cancel.
604+
* Setting NULL will cancel all requests.
603605
*
604606
* @return $this The client object.
605607
* @see sendAsync()
@@ -775,9 +777,10 @@ protected function send(Request $request)
775777
* Dispatches the next response in queue, i.e. it executes the associated
776778
* callback if there is one, or places the response in the response buffer.
777779
*
778-
* @param int $sTimeout If a response is not immediately available, wait
779-
* this many seconds. If NULL, wait indefinitely.
780-
* @param int $usTimeout Microseconds to add to the waiting time.
780+
* @param int|null $sTimeout If a response is not immediately available,
781+
* wait this many seconds.
782+
* If NULL, wait indefinitely.
783+
* @param int $usTimeout Microseconds to add to the waiting time.
781784
*
782785
* @throws SocketException When there's no response within the time limit.
783786
* @return Response The dispatched response.

0 commit comments

Comments
 (0)