简体   繁体   English

具有同一服务器唯一配置项的Composer私有git存储库

[英]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.

相关问题 PHP Composer 全局配置私有仓库 URL 列表 - PHP Composer Global Configuration Private Repositories URL List Composer下载私有GitHub存储库 - Composer to download private GitHub repositories CloudControl:如何在映像构建过程中使用Composer安装私有存储库? - Cloudcontrol: how to install private repositories with composer during image build process? 生产中的Private Composer存储库,最好的方法是什么? - Private Composer repositories in production, what is the best way to go? 使用PHP与私有Composer存储库的AWS Elastic Beanstalk - AWS Elastic Beanstalk using PHP with Private Composer Repositories 作曲家:在BitBucket上缓存私有GIT存储库 - Composer: cache private GIT repository on BitBucket 不具有.git目录的Composer从私有GIT存储库安装软件包 - Composer install package from private GIT repository without the .git directory 全局依赖项存储库-Composer - Global dependency repositories - Composer 从Travis CI(和其他CI工具)上的源缓存与Composer一起安装的git存储库? - Cache git repositories installed with Composer from source on Travis CI (and other CI tools)? 在Build Server上使用VCS在GitHub上使用Composer和Private Repository - Using Composer and Private Repository on GitHub using VCS on Build Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM