Page 1 of 1

autoloader bug in xampp PEAR/DB

PostPosted: 08. February 2012 21:49
by molecularbear
xampp 1.7.7 includes version 1.7.13 of the PEAR/DB package. When using the PEAR/DB/mysql.php driver, I have encountered a bug when calling execute() on a PEAR/DB object. What happens is that a call to PEAR/DB/common.php's execute() is made, which in turn does a DB::isError check on the result of $this->executeEmulateQuery($stmt, $data). The problem is isError is defined like this:

Code: Select all

    function isError
($value)
    {
        return is_a($value, 'DB_Error');
    }
 


Because I have autoloading turned on, and because $value is an SQL string in this case, I get an error that looks like this:

Code: Select all
ERROR: The class 'SELECT * FROM foo' could not be found in ...


In version 1.7.14 of PEAR/DB, the problem has apparently been fixed:

Code: Select all

    function isError
($value)
    {
        return is_object($value) && is_a($value, 'DB_Error');
    }
 


Long story short: xampp should probably use PEAR/DB 1.7.14.

Re: autoloader bug in xampp PEAR/DB

PostPosted: 08. February 2012 21:59
by Altrea
well, it's PEAR.
update it!?

Maybe i don't understand, what you really want to say :D

Re: autoloader bug in xampp PEAR/DB

PostPosted: 08. February 2012 22:53
by molecularbear
Altrea wrote:Maybe i don't understand, what you really want to say :D


I was just recommending that xampp be packaged with PEAR/DB version 1.7.14 instead of the (possibly) broken PEAR/DB 1.7.13.