PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #1920

setFrom is slow

Details

Request #1920setFrom is slow
Submitted2004-07-20 09:24 UTC
Fromcontact at mann dot fr
StatusDuplicate
PackageDB_DataObject
PHP VersionIrrelevant
OSLinux (Debian i586)
Roadmaps(Not assigned)

Comments

[2004-07-20 09:24 UTC] contact at mann dot fr

Description:
------------
Date slow the performance of the class in a significant manner.

The require_once call is already in a conditional statement of the class.

[2004-07-20 10:23 UTC] contact at mann dot fr

If Date is always needed, it should be in a require_once at the top of the file.
Line 2993 DB_DataObject Version ???

Voici le code

case ($cols[$col] & DB_DATAOBJECT_DATE):
if (is_numeric($value)) {
$this->$col = date('Y-m-d',$value);
return true;
}
// try date!!!!
include_once 'Date.php';
$x = new Date($value);
$this->$col = $x->format("%Y-%m-%d");
return true;

[2004-07-20 14:54 UTC] contact at mann dot fr

Perhaps a note to the on-line php documentation.
Date not being abailable, it is logical to exit.
Of course.
I had the feeling that include_once differed from require_once because when I profiled, I noticed that the performance was significantly different using one or the other calls.
OK TO CLOSE BUG