我收到了大四的请求,使用composer 将已下载到文件夹的所有magento内容移动到根文件夹。他希望通过运行composer install来自动化该过程。
以下是我为执行上述任务而编写的代码:
{
"repositories": [
{
"type": "package",
"package": {
"name": "magento",
"type": "webroot",
"version": "1.8",
"dist": {
"type": "zip",
"url": "https://github.com/amacgregor/magento-1.8/archive/master.zip"
},
"require" : {
"fancyguy/webroot-installer": "1.0.0"
}
}
}
],
"require": {
"magento": "1.8",
"fancyguy/webroot-installer": "1.0.0"
},
"extra": {
"webroot-dir": "public",
"webroot-package": "magento"
},
"scripts": {
"post-install-cmd": [
"php -r \"shell_exec('cp -rf public/. .');\"",
"php -r \"shell_exec('rm -rf public');\""
]
}
}
如您所见,我将软件包下载到公用文件夹,然后使用composer脚本将其移出。 流程是否正确?如果我遵循这个程序,它将来会妨碍项目吗?