Hello,
I’m currently in a small refactoring of a ZF2 application (I’m testing things in a “proof of concept” purpose of a possible migration to ZF3 without much trouble). For the moment, I’m adding other small third party libraries aside ZF2, by adding them in the root directory dedicated to third party libraries of other Php vendors like this:
•…/lib-vendors/zf/Zend/…
•…/lib-vendors/abc/Rich/Editor/…
•…/lib-vendors/123/Math/…
•…etc
I know that it’s possible to declare several autoload functions of Php Classes in the index.php file (a.k.a. the bootstrap) of the “web application”, like this:
spl_autoload_register('loaderOfClasses_withClassmap');
spl_autoload_register('loaderOfClasses_abc_withLoopPSR0compliant');
spl_autoload_register('loaderOfClasses_123_withLoopPSR4compliant');
I saw that in Zend\Loader component, that there are several autoloading strategies for Php Classes. So I’m using something like this:
Zend\Loader\AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => (array('autoregister_zf' => true)),
Zend\LoaderClassMapAutoloader' => array(__DIR__.'/autoload_classmap.php')
));
So, my question - now - is: is it possible to add (and how) as new parameters of the AutoloaderFactory::factory, the knowledge of the functions, above, requiring Classes (named loaderOfClasses_abc_withLoopPSR0compliant, loaderOfClasses_123_withLoopPSR4compliant). If I’ve understood more or less the ZF2 documentation, it should would be 3 new variants of a StandardAutoloader strategy?
Regards.