zend-loader
zend-loader copied to clipboard
Class Map Generator removed
You mention the Class Map Generator (bin/classmap_generator.php) on the docs but removed it when zend-loader got separated from zf2. Did you miss the file ou should I remove from docs?
+1 I used the classmap_generator.php of zendframework/zendframework package (https://github.com/zendframework/zendframework/blob/release-2.5.3/bin/classmap_generator.php) but actually i'm including each package as separate package, so I do not have those files anymore.
How can I recover a classmap_generator.php file?
Meanwhile I published this: https://github.com/pensiero/zend-generators
A classmap generator shouldn't be needed at all if you just rely on composer's...
Actually in my Module.php the getAutoloaderConfig()
method use it:
public function getAutoloaderConfig()
{
if (getenv('ENV') == 'development') {
return [
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/../src/' . __NAMESPACE__,
],
],
];
} else {
return [
'Zend\Loader\ClassMapAutoloader' => [
__DIR__ . '/../config/autogenerated/autoload_classmap.config.php',
],
];
}
}
should I replace it with something else?
PS: autoload_classmap.config.php
is the file generated by the classmap_generator.php
script
@pensiero just move all that stuff in your composer.json
"autoload"
section, sit back and relax :-)
Am I good this way?
"autoload": {
"psr-4": {
"Uala\\": "module/Uala/src/",
}
},
Correct. No more need for pesky manual classmaps.
I wanted to provide a PR, updating the documentation. However, ClassMapAutoloader
documentation suggests the usage of classmap_generator.php
.
Is there a valid use case for ClassMapAutoloader
, without the generator? How would a classmap be generated, if the generator is gone? Is it compatible with a classmap generated by Composer? But then why would one not use Composer?
It seems that ClassMapAutoloader
can be removed as well. @Ocramius / @froschdesign can you confirm that?
This repository has been closed and moved to laminas/laminas-loader; a new issue has been opened at https://github.com/laminas/laminas-loader/issues/1.