autoload with namespace

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

 



I haven't been keeping an eye on this list so if this has come up before please point me in the right direction. :)

Playing around with dev PHP 5.3 and namespaces, I'm finding it hard to write an autoload function. Since autoload will be triggered on any namespace call, the request could be for a namespace function or constant. Ex:

FOO::BAR::me() ## A namespace function or class static function?
FOO::BAR::ME   ## A namespace constant or class constant?

Since there isn't really a way for PHP to know what it is looking for, what would be a good method to write the autoload? Assuming the file structure:

- Namespaces are in separate directories NS1::NS2::Class1 == NS1/NS2/class.Calss1.php - Namespace files and class files are prefixed with ns.*.php and class.*.php (respectively)

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