PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #4767

DB/DataObject.php makes call to non-existent php_error(...) function.

Details

Submitted2005-07-08 02:34 UTC
Frommnorth at ucsd dot edu
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.0.4
OSFreeBSD 5.4-STABLE
Roadmaps(Not assigned)

Comments

[2005-07-08 02:34 UTC] mnorth at ucsd dot edu

Description:
------------
DB_DataOBject Version: 1.7.15
(configure line and php.ini not relevant)

If one instantiates a subclass of DB_DataObject whose member, $__table is not set, DataObject.php correctly falls into an error condition. Unfortunately it calls an error reporting function that doesn't exist, php_error(...). Instead it should be calling trigger_error(...).

Reproduce code:
---------------
I'd have to trim down my code signficantly to create a block of code that reproduces the error, and it really isn't necessary so I'll forego it.

Here's a patch that will fix the bug:

--- DataObject.php-old Thu Jul 7 19:25:40 2005
+++ DataObject.php Thu Jul 7 19:25:46 2005
@@ -402,7 +402,7 @@
}
if (!$this->__table) {
// xdebug can backtrace this!
- php_error("NO \$__table SPECIFIED in class definition",E_USER_ERROR);
+ trigger_error("NO \$__table SPECIFIED in class definition",E_USER_ERROR);
}
$this->N = 0;
$query_before = $this->_query;