Home » Database » DB_DataObject » Bug #1764
_autoloadClass and PHP include_path
Details
| Request #1764 | _autoloadClass and PHP include_path |
|---|---|
| Submitted | 2004-07-01 14:17 UTC |
| From | s dot ballestrero at firenze dot linux dot i |
| Status | No Feedback |
| Package | DB_DataObject |
| PHP Version | Irrelevant |
| OS | Any |
| 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.