composer/composer — pull request #387 by beberlei (2012-03-05 12:31:01+00:00)
Title: Add support for class-map generation.

Classmaps for packages can be generated by adding the following key to composer.json:

{
"autoload": {"classmap": ["src1", "src2"]
}

The ClassLoader is extended to contain a "ClassLoader::addClassMap()" method.

The classmap is generated into "vendor/.composer/autoload_classmap.php". In the future it would be easy to add a command that generates a class map from the whole vendor directory and creates a larger "autoload_classmap.php". PSR-0 then only acts as fallback for missing classes.

I tested this with custom Zeta Package:

"repositories": [
{
"type": "package",
"package": {
"name": "zeta/base",
"version": "1.0.0",
"source": {
"url": "http://svn.apache.org/repos/asf/incubator/zetacomponents/trunk",
"type": "svn",
"reference": "Base"
},
"autoload": {
"classmap": ["src"]
}
}
},
{
"type": "package",
"package": {
"name": "zeta/workflow",
"version": "1.0.0",
"source": {
"url": "http://svn.apache.org/repos/asf/incubator/zetacomponents/trunk",
"type": "svn",
"reference": "Workflow"
},
"autoload": {
"classmap": ["src"]
}
}
}
],