PEAR is archived and read-only

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

Home » HTML » HTML_Template_Flexy » Bug #6287

problems with __autoload

Details

Submitted2005-12-19 14:54 UTC
Fromrashid at ds dot pg dot gda dot pl
StatusWont fix
PackageHTML_Template_Flexy
PHP Version5.0.5
OSwindows
Roadmaps(Not assigned)

Comments

[2005-12-19 14:54 UTC] rashid at ds dot pg dot gda dot pl

Description:
------------
There is a problem with compiling templates when __autload is defined in application. It is related to known problem with class_exist and instanceof calls which caused inclusion of source files if class was not defined yet.

In HTML_Template_Flexy_Token, line 95:
if (!class_exists($c) && !isset($loaded[$token])) {
class_exist call causes __autoload call, which is unable to find the file, because it should be loaded from include_path.

AFAIK this behaviour has been changed in 5.1, but it still hurts badly in lower versions. From what I see in the code - $loaded array element is set if file has been included, so !class_exist($c) check does not seem to be required. I understand that this is done to avoid multiple file_exist calls, but after removing the line the only file_exist calls would be for token classes included from outside of this method and this should not be often.

[2006-03-01 15:51 UTC] kaa at 908 dot dp dot ua

Changing
class_exists($c) to class_exists($c, false)
fixs the problem.

it will be nice, if sombody include this in repository.