Am 12.12.2007 um 00:24 schrieb Stanislav Malyshev:

namespace Name::Space;
class Ship {
 public static function __autoload($className) {
   if(strpos($className, 'Name::Space::') === 0) {
     // the real deal
    }
 }
}
...
spl_autoload_register(array('Name::Space::Ship', '__autoload'));
No disk access. And with my suggestion to allow limiting autoloaders to

I don't understand. Is your autoloader going to do any disk accesses at all or it's just a stub that doesn't load any classes? If it does disk access, it would do it on any internal class access inside namespace Name::Space. Please explain me in detail how it could ever happen otherwise.

I was assuming there was no need to explain that "// the real deal" is where the class loading goes.

Look. If you have an autoloader for Your::Namespace, then you just need to check if the class name (which is fully qualified, with the entire namespace prefix in the name) starts with "Your::Namespace" to prevent disk access.


David

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

Reply via email to