gpt4 book ai didi

symfony-2.1 - Symfony2 Composer 添加自己的捆绑要求

转载 作者:行者123 更新时间:2023-12-01 04:38:44 25 4
gpt4 key购买 nike

如何通过 Composer 将特定的 Bundle(例如 SonataGoutteBundle)安装到我的 Symfony2 项目?

我试过了,但对我不起作用。有什么问题吗?

"repositories": [
{
"type": "package",
"package": {
"name": "sonata-project/sonatagouttebundle",
"version": "dev-master",
"dist": {
"url": "https://github.com/sonata-project/SonataGoutteBundle.git",
"type": "git"
}
}
}
],
"require": {
"php": ">=5.3.3",
[...],
"sonata-project/sonatagouttebundle": "dev-master"
}

最佳答案

尝试类似的东西

{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/sonata-project/SonataGoutteBundle.git"
}
],

"require": {
"php": ">=5.3.3",
"vendor/bundle": "dev-master"
}
}

SonataGoutteBundle 必须有一个 composer.json

在这种特殊情况下,这会起作用:

"repositories": [
{
"type": "package",
"package": {
"name": "sonata-project/goutte",
"version": "dev-master",
"source": {
"url": "https://github.com/sonata-project/SonataGoutteBundle.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"php": ">=5.3.3",
"sonata-project/goutte": "dev-master"
}

有关所有选项,请参阅 documentation

关于symfony-2.1 - Symfony2 Composer 添加自己的捆绑要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11486446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com