php-从作曲家创建项目-Mercurial
作者:互联网
从Mercurial存储库创建项目时,我遇到一些问题.看起来像这样:
回购= http:// host / application-skeleton
现在,我想创建(签出)应用程序框架并安装所有依赖项.
php composer.phar create-project --repository-url="http://host/application-skeleton" application-skeleton test
除了此步骤外,我还必须做什么?我在application-skeleton composer.json中创建了.
解决方法:
最后,我找到了解决问题的办法.
Composer使用两种不同的机制来加载packages.json文件.
第一种方式-本地文件:
packages.json
{
"package": {
"name": "vendor/package-name",
"version": "dev-default",
"source": {
"type": "hg",
"url": "https://host/packages",
"reference": "585637bc536f"
}
}
}
并致电:
php composer.phar create-project --repository-url="./packages.json" vendor/package-name:dev-master test
第二种方式-远程文件(HTTP):
http://host/packages/packages.json
{
"packages": {
"vendor/package-name": {
"dev-default": {
"name": "vendor/package-name",
"version": "dev-default",
"source": {
"type": "hg",
"url": "https://host/vendor/package-name",
"reference": "585637bc536f"
}
}
}
}
}
并致电:
php composer.phar create-project --repository-url="http://host/packages" vendor/package-name:dev-master test
标签:composer-php,version-control,php,mercurial 来源: https://codeday.me/bug/20191030/1969978.html