Community discussions

MikroTik App
 
gaztelugatxe
just joined
Topic Author
Posts: 3
Joined: Wed Nov 29, 2017 11:39 pm

PEAR2_Net_RouterOS-1.0.0b6 and dummy fast-track rule

Sat Apr 21, 2018 12:31 pm

Hi all and specially boen_robot,

when trying to use the PEAR2 PHP API I find the following problem. Commands that should work such as:
$util->setMenu('/ip firewall filter');
$util->disable();
don't work when the special dummy rule to show fasttrack counters is present. PHP throws an error saying that a protected value has been accessed:
PEAR2\Net\RouterOS\RouterErrorException: Error when disabling items in /var/www/html/pru/PEAR2_Net_RouterOS-1.0.0b6/src/PEAR2/Net/RouterOS/Util.php:634 Stack trace: #0 /var/www/html/pru/ros_4_fw.php(73): PEAR2\Net\RouterOS\Util->disable() #1 {main} Response collection: Array ( [0] => PEAR2\Net\RouterOS\Response Object ( [unrecognizedWords:protected] => Array ( ) [_type:PEAR2\Net\RouterOS\Response:private] => !trap [attributes:protected] => Array ( [message] => failure: cannot change builtin ) [_tag:PEAR2\Net\RouterOS\Message:private] => ) [1] => PEAR2\Net\RouterOS\Response Object ( [unrecognizedWords:protected] => Array ( ) [_type:PEAR2\Net\RouterOS\Response:private] => !done [attributes:protected] => Array ( ) [_tag:PEAR2\Net\RouterOS\Message:private] => ) ) 
If we skip that first dummy rule, for example:
$util->disable(1);
no error happens and the rule is disable.

Is there any way to skip that dummy rule when using disable(), enable() or find() ?

Thanks in advance.
Gerardo.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: PEAR2_Net_RouterOS-1.0.0b6 and dummy fast-track rule

Sat Apr 21, 2018 11:20 pm

Discussion happed at this GitHub issue.

(for future reference of other people reading the forum)

Who is online

Users browsing this forum: Guntis, netmas and 13 guests