Closed pspiller closed 10 years ago
Thanks for your PR - interested to get @Flyingmana 's input on this since he has been very active on the magento-composer-installer project recently. Without having looked at the code, I generally like added fleibility in regards to file system path structures.
Thank you very much for this contribution, I like the Idea. I will test this when I have more Time again.
Also I am not sure about the way you have implemented this, but this can get refactored later from me :)
Guys, is there any documentation about this?
And another question... Can I describe mapping in the package? Ie, I require a package in magento, and I need no to describe a map here.
@andkirby there is documentation in the readme and the docs directory. I assume your search for the normal mapping via a modman file, as the here implemented feature does not make sense on package level.
We could also use another communication channel like mail, irc or gitter if you need assistance.
Ok, thanks! You know, I've used feature "map" in "extra". So, my packages has following:
"extra": {
"map": [
["src/app/bootstrap.php", "app/"],
["src/app/autoload.php", "app/"],
["src/dev/", "dev/"],
["src/lib/Magento/", "lib/Magento/"]
]
}
In this case I need no to describe deploying mapping.
Thanks for your help! :)
This pull request adds the ability to specify a set of translations that are applied to the path mappings magento-composer-installer uses to symlink extension files. This is useful if some types of extension files need to be linked into non-standard locations.
We maintain a Magento fork called Mercator (https://github.com/mercator). One change we made in Mercator was to put web-accessible files (CSS, JS, images) under a 'public' directory. This can then be used as the web server's document root, preventing accidentally exposing private files (i.e. local.xml).
This change to the file structure means that extensions that include public files need to be handled correctly. We use Composer to manage the extensions included in Mercator, so one option would have been to rewrite the modman files/composer.json map sections/etc for all of them. However, this required making backwards-incompatible changes and made it harder to add extensions. Instead, we modified magento-composer-installer to allow specifying a set of transformations. These are applied to each path mapping, and allow us to have web-accessible files automatically moved into the public directory. This allows extensions to be installed without changing their path mapping information. We thought this functionality might be useful to anybody running a similarly-modified version of Magento.
For example, the set of path mappings we specify in Mercator's composer.json are:
A partial example of a modman file used by one of the included extensions:
With the above path mappings in place, when this modman file is processed it will be interpreted as:
The 'skin' and 'js' files will be linked into place under the public directory, while everything that wasn't translated will be linked as normal.