autoloader bug in xampp PEAR/DB
Posted: 08. February 2012 21:49
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:
Because I have autoloading turned on, and because $value is an SQL string in this case, I get an error that looks like this:
In version 1.7.14 of PEAR/DB, the problem has apparently been fixed:
Long story short: xampp should probably use PEAR/DB 1.7.14.
- 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.