Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #19491 non-static PEAR::isError()
Submitted: 2012-07-02 02:23 UTC
From: wolfdogg Assigned: danielc
Status: Closed Package: MDB2
PHP Version: 5.2.17 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 30 + 37 = ?

 
 [2012-07-02 02:23 UTC] wolfdogg (wolf dogg)
Description: ------------ i cant seem to get to the bottom of this anymore Actual result: -------------- ERRNO: 2048 TEXT: Non-static method PEAR::isError() should not be called statically LOCATION: /usr/share/pear/MDB2.php, line 382, at July 1, 2012, 12:15 pm Showing backtrace: PEAR.isError() # line 382, file: /usr/share/pear/MDB2.php MDB2.factory("mysqli://dbuser:dbpass@127.0.0.1/dbmname", false) # line 474, file: /usr/share/pear/MDB2.php MDB2.singleton("mysqli://dbuser:dbpass@127.0.0.1/dbmname ") # line 13, file: /libs/mdb2.php DbManager.__construct("mysqli://dbuser:dbpass@127.0.0.1/d bmname") # line 18, file: /file.class.php

Comments

 [2012-07-02 05:16 UTC] wolfdogg (wolf dogg)
it seems i have been able to bypass it by adding the static method in front of the functino declaration on line 250 of PEAR.php static function isError($data, $code = null) { if (!is_a($data, 'PEAR_Error')) { return false; } if (is_null($code)) { return true; } elseif (is_string($code)) { return $data->getMessage() == $code; } return $data->getCode() == $code; }
 [2012-07-02 05:17 UTC] wolfdogg (wolf dogg)
this fix is just temporary until a PEAR developer can verify that this is a proper fix please
 [2012-08-18 13:45 UTC] wolfdogg (wolf dogg)
can somebody look into this, because everytime i update my linux i get this same error, then i have to make this edit to my code.
 [2012-08-27 18:35 UTC] danielc (Daniel Convissor)
-Assigned To: +Assigned To: danielc
 [2012-08-27 20:35 UTC] danielc (Daniel Convissor)
-Status: Assigned +Status: Closed
Committed in http://svn.php.net/viewvc?view=revision&revision=327310
 [2012-09-01 23:42 UTC] wolfdogg (wolf dogg)
Thanks for looking into this. Its nice to see this stuff moving forward. much appreciated. :-)
 [2012-09-02 00:58 UTC] wolfdogg (wolf dogg)
danielc, i think the same modifications need to be made to pear/MDB2.php and for any one else, you also will need to update your dbwrapper where you call the MDB2::singleton or however your using MDB2 and referencing the pear library. I think i copied mine from an older version of a wrapper i was using from the DB() days before upgrading to MDB2. It must have also called it that way (PEAR::isError).
 [2012-09-02 01:04 UTC] wolfdogg (wolf dogg)
i found another file, pear/MDB2/Driver/mysqli.php, and i guess would be the same for all drivers. Am i missing something, were these files already updated and i missed a lite of updated files? I just saw that the MDB2.php file was updated. How many more files do i need to look for. should i run grep -lre 'PEAR::isError' ./* on the entire pear/MDB2 folder and replace all?
 [2012-09-02 01:10 UTC] wolfdogg (wolf dogg)
ok, im still a newb here on PEAR bugs, and i figured it out, sorry about that. i see that the link has a list of all files that were edited. Somehow i thought only one of those files was pertaining to this bug. looks like you swept through the whole package. my bad. ill leave it here, but can somebody tell me what action one would take at this point, should i just go to command line and pear update the package, or should i remove then reinstall the package, or run a patch? its not a live server, just a testing ground so its not mission critical for me if something breaks and needs fixing.
 [2012-09-02 01:52 UTC] danielc (Daniel Convissor)
-Package: PEAR +Package: MDB2
Hey Wolfdogg: The new version hasn't been released yet. It's only in the Subversion repository. You can manually update your installation with those files, if so desired. --Dan