[英]Composer private git repositories with unique configuration item for the same server
I have a private git repository located at username@somedomain.com, that i access with ssh. 我有一个私人的git仓库,位于username@somedomain.com,可通过ssh访问。
I need to include 2 projects from the same server, and i do like this: 我需要包含来自同一服务器的2个项目,我这样做是:
"require": {
"proj1": "dev-master",
"proj2": "dev-master",
},
"repositories": [
{
"type": "vcs",
"url": "username@somedomain.com:proj1.git"
},
{
"type": "vcs",
"url": "username@somedomain.com:proj2.git"
}
]
May happen that these repo grow in number. 这些回购的数量可能会增加。 Is there any chance where i can configure something like
有没有机会我可以配置类似
"url": "username@somedomain.com"
and let composer resolve where to find the packages? 并让作曲家确定在哪里可以找到软件包?
Please note that i don't want to use satis or any other package manager. 请注意,我不想使用satis或任何其他包管理器。
There is only way to handle private projects without direct definding insided composer.json
-- use Satis or Toran Proxy. 只有处理私人项目没有直接definding insided方式
composer.json
-使用赛帝或Toran代理。
https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md
Composer allows you to add repositories that will also be scanned for packages in addition to using Packagist. Composer允许您添加存储库,除了使用Packagist之外,还将对软件包进行扫描。
Note that you didn't specify which package is to be found in these repositories because Composer will scan these for composer.json
itself and detect which packages are available (one repository might contain more than one package in different branches!). 请注意,您没有指定要在这些存储库中找到哪个软件包,因为Composer会扫描它们以查找
composer.json
本身并检测哪些软件包可用(一个存储库在不同分支中可能包含多个软件包!)。
Because every repository is independent of each other, you have to mention them all individually. 因为每个存储库都彼此独立,所以您必须单独提及它们。
Also note that Composer only allows to add these repositories on the root level, so you have to repeat every repository that is being used in your dependencies again in the root project, even if that root project does not have a direct dependency to a package that is provided in such a repository. 还要注意,Composer仅允许在根级别上添加这些存储库,因此,即使该根项目与该软件包没有直接的依赖关系,您也必须在根项目中再次重复使用您的依赖项中的每个存储库。在这样的存储库中提供。
The way to avoid this is to have a Packagist-like repository that is created via Satis, Toran or a local installation of Packagist itself. 避免这种情况的方法是通过Satis,Toran或Packagist本身的本地安装创建类似Packagist的存储库。 I recommend going that way even if you say you don't want to.
即使您说不想,我还是建议您那样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.