composer/composer — Issue #351: Add "map" declarations.
Author: colinmollenhour
Created: 2012-02-22 00:46:31+00:00
State: open

I wrote a simple shell script named "modman" which is used quite a bit in the Magento community. Composer is great, but if it provided the same basic functionality as modman it would be even better! It could be used to link your modules, skins, assets, etc into the project root. Magento splits up these locations for both files and directories. I propose one could simply give a mapping of real paths to target paths to be symlinked.

Example:
```
{
"map" : {
"themes/default/skin":"public/skin/frontend/foo/default",
"themes/default/design":"public/app/design/frontend/foo/default",
"modules/My_Module/My_Module.xml":"public/app/etc/modules/My_Module.xml",
"modules/My_Module/code":"public/app/code/local/My/Module",
"modules/My_Module/frontend/layout/mymodule.xml":"public/app/design/frontend/base/default/layout/mymodule.xml"
}
```

Modman uses symlinks to do this mapping (using ln -s). However, the php symlink() function is supported since Vista/Server 2008 which is I think quite a reasonable requirement. Modman supports more advanced features like specifying a base for the target paths, but that could be added easily as well:
```
{
"map" : {
"base":"public",
"paths":{
"themes/default/skin":"skin/frontend/foo/default",
"themes/default/design":"app/design/frontend/foo/default",
"modules/My_Module/My_Module.xml":"app/etc/modules/My_Module.xml",
"modules/My_Module/code":"app/code/local/My/Module",
"modules/My_Module/frontend/layout/mymodule.xml":"app/design/frontend/base/default/layout/mymodule.xml"
}
}
```

Support for this feature would make it quite feasible to deploy Magento on PHPFog.com. Otherwise the repository is just too bloated and disorganized.

Modman tutorial: https://github.com/colinmollenhour/modman/wiki/Tutorial