Skip to content

Commit 56fa48c

Browse files
committed
Pimped the README.md;
Adjusted the roscon.bat to return 255 on failure, and the PHP status code otherwise; Fixed the suggested command in the console's connection error message (needed to include protocol); Updated wiki; Added a trailing newline to XML and YAML files, as suggested by SensioLabsInsight.
1 parent 6e41221 commit 56fa48c

File tree

9 files changed

+49
-35
lines changed

9 files changed

+49
-35
lines changed

.scrutinizer.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ tools:
1212
php_cpd: true
1313
php_code_sniffer:
1414
config:
15-
standard: PEAR
15+
standard: PEAR
16+

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
See the project wiki for installation instructions and other documentation.
1+
Project: [![Total Downloads](https://poser.pugx.org/pear2/net_routeros/downloads)](https://packagist.org/packages/pear2/net_routeros) [![License](https://poser.pugx.org/pear2/net_routeros/license)](https://packagist.org/packages/pear2/net_routeros)
22

3-
The sources as visible here reflect the development version. They may contain parsing errors, fail to install or have all other sorts of errors. If you want to use this package, download the packaged archives instead.
3+
Stable: [![Dependency Status](https://www.versioneye.com/php/pear2:net_routeros/dev-master/badge.svg)](https://www.versioneye.com/php/pear2:net_routeros/dev-master)
4+
5+
Unstable: [![Dependency Status](https://www.versioneye.com/php/pear2:net_routeros/dev-develop/badge.svg)](https://www.versioneye.com/php/pear2:net_routeros/dev-develop)
6+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pear2/Net_RouterOS/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/pear2/Net_RouterOS/?branch=develop)
7+
8+
See [the project wiki](https://github.com/pear2/Net_RouterOS/wiki) for installation instructions and other documentation.
9+
10+
You can download packaged archives (which include dependencies) from [SourceForge](http://sourceforge.net/projects/netrouteros/) or the [releases page on GitHub](https://github.com/pear2/Net_RouterOS/releases).

data/roscon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ Defaults to PHP's default_socket_timeout ini option.</description>
108108
<description>Turn on multiline mode. Without this mode, every line of input is considered a word. With it, every line is a line within the word, and the end of the word is marked instead by an "end of text" character as the only character on a line. To write out such a character, you can use ALT+Numpad3. If you want to write this character as part of the word, you can write two such characters on a line.</description>
109109
<action>StoreTrue</action>
110110
</option>
111-
</command>
111+
</command>

docs/phpdoc.dist.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
<transformer>
1515
<target>Reference/PhpDocumentor/Doc</target>
1616
</transformer>
17-
</phpdoc>
17+
</phpdoc>
18+

docs/sami.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
use Sami\Sami;
3-
use Sami\Version\GitVersionCollection;
43
use Symfony\Component\Finder\Finder;
54

65
return new Sami(

docs/wiki

Submodule wiki updated from 1d60ee8 to fc21ecb

scripts/roscon.bat

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
@echo off
2-
REM Prefer PHP binary in the following order:
3-
REM 1. Whatever %PHPBIN% points to.
4-
REM 2. "php" from %cd% with one of %pathext% extensions.
5-
REM 3. "php" from a %path% path with one of %pathext% extensions.
6-
REM 4. Whatever %PHP_PEAR_PHP_BIN% points to.
7-
REM
8-
REM Once a binary is found, a file is looked for that has the same name as
9-
REM this batch file.
10-
REM Preferred extensions are ".php" and then no extension.
2+
:: Prefer PHP binary in the following order:
3+
:: 1. Whatever %PHPBIN% points to.
4+
:: 2. "php" from %cd% with one of %pathext% extensions.
5+
:: 3. "php" from a %path% path with one of %pathext% extensions.
6+
:: 4. Whatever %PHP_PEAR_PHP_BIN% points to.
7+
::
8+
:: Once a binary is found, a file is looked for that has the same name
9+
:: (including folder) as this batch file.
10+
:: Preferred extensions are ".php" and then no extension.
11+
::
12+
:: On failure to find PHP binary or a PHP file, this batch file returns 255.
1113
goto SET_BIN
1214
:PHP_ERR
1315
echo PHP interpreter not found. Please set the %%PHPBIN%% or %%PHP_PEAR_PHP_BIN%% environment variable to one, or add one to your %%PATH%%.
14-
goto :eof
16+
setlocal
17+
goto :END
1518
:FILE_ERR
1619
echo The file to be ran was not found. It should be at either "%~d0%~p0%~n0.php" or "%~d0%~p0%~n0".
17-
endlocal
18-
goto :eof
20+
goto :END
1921
:SET_BIN
2022
if "%PHPBIN%" == "" set PHPBIN=php
2123
where /q %PHPBIN%
2224
if %ERRORLEVEL% == 0 goto SET_FILE
2325
if "%PHP_PEAR_PHP_BIN%" == "" goto PHP_ERR
24-
where /q "%PHP_PEAR_PHP_BIN%"
26+
where /q "%PHP_PEAR_PHP_BIN%" 2>nul
2527
if %ERRORLEVEL% neq 0 goto PHP_ERR
2628
set PHPBIN=%PHP_PEAR_PHP_BIN%
2729
:SET_FILE
@@ -33,4 +35,7 @@ if exist "%PHPFILE%" goto RUN
3335
goto FILE_ERR
3436
:RUN
3537
"%PHPBIN%" "%PHPFILE%" %*
36-
endlocal
38+
set PHPBIN_ERRORLEVEL="%ERRORLEVEL%"
39+
:END
40+
if "%PHPBIN_ERRORLEVEL%" == "" set PHPBIN_ERRORLEVEL=255
41+
exit /B %PHPBIN_ERRORLEVEL%

scripts/roscon.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,20 +317,20 @@
317317
6. The router has a firewall filter/mangle/nat rule that overrides the settings
318318
at the "/ip service" menu.
319319
Usually, those are rules in the "input" chain.
320-
Theoretically, rules in the "prerouting", "dstnat", "output" and/or
321-
"postrouting" chains can also cause such an effect.
322-
By default, RouterBOARD devices have a filter rule in the "input" chain that
323-
drops any incoming connections to the router from its WAN interface, so if
324-
your web server is not in the LAN, the connection may be dropped because of
325-
that.
326-
If that's the case, either disable that rule, or explicitly whitelist the
327-
API port. You can whitelist the API port on all interfaces by issuing the
328-
following command from a terminal:
320+
Theoretically (rarely in practice), rules in the "prerouting", "dstnat",
321+
"output" and/or "postrouting" chains can also cause such an effect.
322+
By default, many RouterBOARD devices have a filter rule in the "input" chain
323+
that drops any incoming connections to the router from its WAN interface,
324+
so if your web server is not in the LAN, the connection may be dropped
325+
because of that.
326+
If that's the case, either disable that rule (not recommended), or
327+
explicitly whitelist the API port. You can whitelist the API port on all
328+
interfaces by issuing the following command from a terminal:
329329
```
330-
/ip firewall filter
331-
add place-before=[:pick [find where chain="input"] 0] \
332-
chain="input" action="accept" \
333-
dst-port=[/ip service get "api" "port"]
330+
/ip firewall filter add \
331+
place-before=[:pick [find where chain="input"] 0] \
332+
chain="input" action="accept" \
333+
protocol="tcp" dst-port=[/ip service get "api" "port"]
334334
```
335335
336336
HEREDOC

tests/phpunit.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,5 @@
175175
<directory suffix=".php">../src/PEAR2/Net/RouterOS</directory>
176176
</whitelist>
177177
</filter>
178-
</phpunit>
178+
</phpunit>
179+

0 commit comments

Comments
 (0)