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 #1764

_autoloadClass and PHP include_path

Details

Request #1764_autoloadClass and PHP include_path
Submitted2004-07-01 14:17 UTC
Froms dot ballestrero at firenze dot linux dot i
StatusNo Feedback
PackageDB_DataObject
PHP VersionIrrelevant
OSAny
Roadmaps(Not assigned)

Comments

[2004-07-01 14:17 UTC] s dot ballestrero at firenze dot linux dot i

Description:
------------
DataObject::_autoloadClass() uses file_exists()
to look for an include file. Unfortunately, file_exists()
does not know about the PHP include path, so it will fail if the class_location is relative to a path in include_path.

I think it would be more consistent (with the standard include() and require() behaviour) to either skip the test and just use require_once() instead of include_once(), or loop trough explode(':', get_include_path()).

The reason for this is to make it easier to relocate the
"library" part of a PHP application to a filesystem area
that is not accessible for the web server, or to share a single DataObjects dir amongst different apps.