My Magento environment is structured as following:
composer.jsonwhich includes"aoepeople/composer-installers": "*"and a list of Magento modules that deploy the code into my.modmandirectory. From here, i deploy the files throughmodman deploy-allinto the Magento root folder.
So these are my steps, when a new extension update is available:
- composer update
- Inspect changes of the module code in the .modman folder
- git commit
- modman deploy-all
- git push: Starts remote Magento deployment
This works as expected.
When i use the package avstudnitz/scopehints or mb/translate in my composer.json, the folders .modman/scopehints and .modman/translate are created. However, i would prefer a foldername including the vendor name, like the name of the Magento module itself, such as .modman/AvS_ScopeHint and .modman/MB_Translate for clarity.
Is there a way to define the composer deploy foldername for each Magento package?
1 Answer 1
Yes and no. In the extras.installer-paths configuration, you can use the variables {$name} and {$vendor}. But there is no way to get the name of the Magento module itself because it is not part of the module's composer configuration.
I use configuration like this:
"extra":{
"installer-paths": {
"www/" : [ "type:magento-source" ],
".modman/{$vendor}_{$name}/" : [ "type:magento-module" ]
}
},
which results in paths such as .modman/avstudnitz_scopehint (coming from the composer package name avstudnitz/scopehint
-
@fschmegler: Is there a way to capitalize the first letter of the $vendor and $name variable?jhoelzl– jhoelzl2015年08月12日 05:48:21 +00:00Commented Aug 12, 2015 at 5:48
-
Not without modification of the composer installer (you could fork it and add
ucfirst()at the right place). But it's still not guaranteed that the result is exactly the Magento module name, so it might be misleadingFabian Schmengler– Fabian Schmengler2015年08月12日 06:11:59 +00:00Commented Aug 12, 2015 at 6:11