我正在尝试为Magento 2开发一个主题,创建一个作曲器模块,加载Magento 2作为开发依赖项,将其安装到一个子文件夹中,并从一个单独的src/子目录中链接我的主题。
我目前正在尝试在我的composer.json文件中执行以下操作,从而将模块安装到根目录:
"require-dev": {
"composer/installers": "*",
"magento/project-community-edition": "2.0.*"
},
"extra": {
"installer-paths": {
"magento/": ["type:product"]
}
} 在Magento 1上工作时,我能够使用以下目录结构来开发和测试我的模块:
magento/
src/
composer.json
modmancomposer.json设置如下:
"require-dev": {
"composer/installers": "~1.0",
"magento/ce": "1.9.2.*"
},
"extra": {
"installer-paths": {
"magento": ["type:magento-source"]
}
}Magento 2有可能做到这一点吗?或者我可以运行两个不同的项目,将我的主题指定为依赖项,如果是这样的话,我如何将它们链接在一起进行开发?
发布于 2016-01-09 00:20:11
您可以使用composer的repository with artifact作为
"repositories": [
{
"type": "artifact",
"url": "path/to/directory/with/zips/"
}
],其中path/to/directory/with/zips/应该包含您的主题的压缩包。
此外,您不需要依赖于"composer/installers"或magento/project-community-edition只需要"magento/framework"
https://stackoverflow.com/questions/34638485
复制相似问题