Use forked repo on github via composer as dependency(通过 composer 在 github 上使用 forked repo 作为依赖)
问题描述
我有一个使用 socalnick/scn-social-auth-doctrine-orm 的项目.该模块进一步依赖于:
I have a project that uses socalnick/scn-social-auth-doctrine-orm. This module further depends upon:
- socialnick/scn-social-auth
这进一步取决于
- hybridauth/hybridauth
所以 ORM 取决于->Social-Auth 这取决于->混合
So ORM Depends on->Social-Auth which depends on->Hybrid
为了使我的应用程序能够正常工作,我需要对这两个模块 (1) 和 (2) 进行一些更改.我将这些模块分叉到我的 git 帐户中,并根据我的要求进行了更改.在我的应用程序 composer.json 中,我只是将 socalnick/scn-social-auth-doctrine-orm 作为要求.
In order for my application to work, I required some changes in these two modules (1) and (2). I forked these modules to my git account and made changes as per my requirement. In my application composer.json I am just putting socalnick/scn-social-auth-doctrine-orm as requirement.
我如何管理 composer.json 以便 socalnick/scn-social-auth-doctrine-orm 获得我的分叉模块而不是默认模块.
How can I manage composer.json so that socalnick/scn-social-auth-doctrine-orm get my forked modules instead of default modules.
推荐答案
您应该在 composer.json
中覆盖该依赖项.
You should override that dependencies in your composer.json
.
{
"require": {
"socalnick/scn-social-auth-doctrine-orm": "*",
"socialnick/scn-social-auth": "*",
"hybridauth/hybridauth": "*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/USER/scn-social-auth.git"
},
{
"type": "git",
"url": "https://github.com/USER/hybridauth.git"
}
]
}
在你的 fork 中,你可以添加一个匹配主包要求的标签,或者使用带有版本号别名的分支:
In your fork you could add a tag that matches the requirements of the main package, or use a branch with a version number alias:
"socialnick/scn-social-auth": "dev-mybranch as 2.1.0",
参考来自 mnapoli 的博文
这篇关于通过 composer 在 github 上使用 forked repo 作为依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:通过 composer 在 github 上使用 forked repo 作为依赖


- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01