Composer安装包依赖项



我创建了一个在GIT回购中设置的自定义包。Composer成功地将文件拉到了供应商目录中的一个目录中,但我需要拉入嵌套的依赖项,我找不到如何实现这一点的答案。

这是主站点的Composer文件,用于提取包:

{
"name": "development/project",
"type" : "project",
"repositories": [
{
"type":"composer",
"url":"https://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "development/package",
"version": "0.0.1",
"source": {
"type": "git",
"url": "https://developer@bitbucket.org/development/package.git",
"reference" : "v0.0.1"
}
}
},
],
"require": {
"php": ">=5.4",
"composer/installers": "~1.0",
},
"require-dev": {
"development/package": "~0.0"
}
}

这是包本身的本地Composer文件:

{
"name": "development/package",
"type" : "project",
"require": {
"php": ">=5.4",
"composer/installers": "~1.0"
},
"require": {
"ellislab/codeigniter": "~3.0"
},
}

因此,我希望发生的是,当我在主站点上运行Composer时,它会拉入"开发/包"(它目前正在做),但也会拉入包依赖项"ellislab/codeigniter"。谢谢你在这方面的帮助。

您的本地包中有无效的composer json,它应该是这样的(没有双require节点):

{
"name": "development/package",
"type" : "project",
"require": {
"php": ">=5.4",
"composer/installers": "~1.0",
"ellislab/codeigniter": "~3.0"
}
}

Composer会自动拉取根包的require节点中定义的所有包,以及每个依赖包的require节点中定义,包括development/package中的ellislab/codeigniter

相关内容

  • 没有找到相关文章

最新更新