Hello Marcus,

In my case at work, my include_path only has three directories: . (current
directory), the PEAR path, and the directory where my company's classes are
stored. In this case, the namespace import will only have to search in
three directories, which is not bad. The class_path would only save me one
directory lookup (.), so the class_path really is not needed here. Looking
again, the need for class_path really depends on whether many PHP users
have large include_paths or not. If the majority have small include_paths
(like in our cases), then I can just use include_path (my patch would be
simplified, also). Still, I'd like to gather more opinions from others.

Regarding __autoload, there is no way for __autoload to receive the full
class name without having to first scan the directories either at compile
or runtime, and of course, when I determine the full class name and path,
why call __autoload? I already know the path of the file I need to include,
so passing the class name to __autoload seems unnecessary. 

For the lookup, I was thinking of searching all the directories in the
class/include_path, even if I get a match in the first directory. In the
case where there are two identically-named classes in two namespaces that
have been imported, then I will generate an error saying that the class
requested is ambiguous. The way the user would disambiguate the class name
is by entering the full class name, e.g. my_ns:class1, for that particular
class. 


--
Jessie


Marcus Boerger wrote:

> might, might, might only assumptions with the big drawback of adding
> another ini setting. My assumption is that i only need one or two
> include/class patchs and that they are of course the same since i want to
> keep my application files together - for working maintanance for one
> reason. Also if __autoload cannot easily get the requested namespace name
> than a compilcated solution has to be worked out since otherwise you end
> up in nightmare of naming conflicts - how should you know in a situation
> where a classname exists in multiple namespaces from which directory to
> load? By order of directory? In the end nothing here would really work
> around the problem thus we need the full name.
> 
> Best regards,
>  Marcus                            mailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to