Menu

#205 Non-static method PEAR::raiseError

1.0
closed
nobody
None
5
2016-02-02
2014-05-30
No

When viewing subnets and trying to sort a column, I get this error and no data is displayed:

Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /var/www/phpipam/functions/PEAR/Net/IPv4.php on line 241

Discussion

  • xconspirisist

    xconspirisist - 2014-06-08

    This is a problem caused as a result of PEAR libraries not being written to E_STRICT. The most recent version of this package (http://pear.php.net/package/Net_IPv4/download/1.3.4) (4 years old) still has the same problem.

    I'm not sure how Miha would suggest getting around this issue - I see lots of calls to change error_reporting in phpipam source, but I'd be more inclined to patch the library as it's no longer maintained;

    MOVE LINE 207 -> LINE 203: $pear = new PEAR();

    CHANGE LINE 241 from "PEAR::raiseError" to $pear()->raiseError();

    I'd be happy to patch up this file to try and follow E_STRICT if Miha is interested in accepting my patch.

     
  • Miha Petkovsek

    Miha Petkovsek - 2014-09-02

    Hi, sure, would be happy if you can provide patch.

    If I understand you correctly what is needed is to first initialise PEAR class and than call functions like you said above?

    brm

     
  • les jones

    les jones - 2014-10-13

    After experiencing this PEAR issue, I made changes as described by xconspirisist. The result cleared the E_STRICT error, however, caused a trivial display of 0.0.0.1-204.68.xxx.xxx, including a total count of addressed from 0.0.0.1 to the active netblock. i.e., 0.0.0.1 - 204.68.xxx.xxx (3427066624)

    The action was SORT IP, which displayed the active netblock in DESC order, then a SORT IP again to revert back to ASC. The reverting back to ASC caused the unusual display above.

    Les

     
  • Anonymous

    Anonymous - 2014-10-28

    What if declaring static functions on the right place?
    It solved this bug.

     
  • Anonymous

    Anonymous - 2015-03-15

    I'm getting similar results, and I have tried to make the above updates with no luck. Am I hitting the same bug?

    Non-static method Net_IPv4::parseAddress() should not be called statically in /srv/www/htdocs/phpipam/functions/functions-tools.php on line 660 Strict Standards:

     
  • Anonymous

    Anonymous - 2015-10-02

    Hello,

    Just add :
    public static function parseAddress($address)
    Instaead of :
    function parseAddress($address)
    in : /var/www/html/phpipam/functions/PEAR/Net/IPv4.php

    It is working now, maybe other will need it

     
  • Anonymous

    Anonymous - 2015-11-05

    After upgrade to phpIPAM 1.1 rev010, I've started to get the following error when using the search feature.
    Non-static method Net_IPv4::parseAddress() should not be called statically in /srv/www/htdocs/phpipam/functions/functions-tools.php on line 660 Strict

    When attempting to sort a subnet by any column, the sort happens, but I get the following error:
    Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /var/www/phpipam/functions/PEAR/Net/IPv4.php on line 240

    This did not exist on the previous version we were running.

    Installed versions:
    php-5.3.3-46
    php-pear-1.9.4-4

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02
    • Status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel