I'm not sure whether this may be an issue in the end or not. But I am
reading reference to fallback autoloader handlers which causes me
concern if the developer has to go through hoops to ensure that the
application only has one spl_autoload registered handler. My concern
here is that if a call to class_exists is used to determine whether a
custom (project/module specific) class should be loaded instead of a
default class.... I realize that there might be some grounds of a DI
but the following code is what concerns me:


if (false === class_exists('ClassA')) { //dynamically check to see if
a local overriding class exists via the autoloader
  $class = new DefaultClass();
} else {
  $class = new ClassA();
}


Having multiple registered spl_autoload handlers will incur
unnecessary cycles, and the developer will not have the ability of
controlling the autoloading stack (e.g circumventing it), I'm
wondering if it would be better to have one registered handler similar
to the ZF1 plugin priority stack.


-- 
Greg

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to