Since the dynamic class loading with Zend\Loader\StandardAutoloader
is very expensive, I generate a classmap and set it in the
Application\Module
public function getAutoloaderConfig()
{
return [
'Zend\Loader\ClassMapAutoloader' => [
__DIR__ . '/../../data/cache' . '/' . 'autoload_classmap.application.php',
],
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
'MyNamespace' => __DIR__ . '/../../vendor/my/lib/src'
]
]
];
}
The file autoload_classmap.application.php
contains a classmap for /module
and /vendor/my/lib/src
.
Is it enough to extend the getAutoloaderConfig()
of only one module (e.g. Application
) or do I need to do that in every the ClassMapAutoloader
?