Re: autoload with namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan Panning wrote:
> Jochem Maas wrote:
>> essentially it boils down to replacing '::' with '/' to determine the
>> path
>> from the namespace in your case - that is easy enough, your still
>> stuck with
>> finding out whether your being asked to load a namespace, class, or
>> function
>> (do namespaced functions even trigger an autoload, if not that
>> obviously makes
>> things simpler. maybe the autoloader can just match the path as deep
>> it can and
>> then load every file inside the determine path. e.g:
> 
> From my testing I've found the autoload function is called for any
> namespace related call, functions and constants.
> 
> Your idea for replacing '::' with '/' is good but I'd think it'll
> interfere with the arithmetic operator '/'. I'm sure they must have
> discussed such options.

He didn't mean doing that in the code syntax, just in the autoload
function to convert it to a filename :)

> Is this something I should bring up on the internals? I think it is an
> issue, autoload not being able to know if it's class or namespace related.
> 
> However, I think the call for namespace functions and constants is good,
> just need to know it's for namespaces... Gives you the opportunity to
> load the missing files.


If you look in the list archives there is a very thorough and detailed
writeup from Martin Alterisio just after xmas on this topic:

http://marc.info/?l=php-internals&m=119864555003877&w=2

This will perhaps make you think about discussing on internals.

Col


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux