如何让 composer 一般识别特定的 github 供应商名称空间,而不是分别指定来自同一供应商的每个存储库

How to make composer recognize particular github vendor namespace in general instead of specifying each repository from the same vendor separately

我正在使用 composer 从我自己的私人 github 帐户安装软件包。

现在,如果我想包含我的 github 中的任何特定包,每次我需要在 repositories 键下的 composer.json 中添加新条目时,如下所示:

"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:VendorNamespace/GitHubRepository1.git",
        "no-api": true
    },
    {
        "type": "vcs",
        "url": "git@github.com:VendorNamespace/GitHubRepository2.git",
        "no-api": true
    },
    .
    .
    .
    {
        "type": "vcs",
        "url": "git@github.com:VendorNamespace/GitHubRepository100.git",
        "no-api": true
    }
]

而不是这样做,我希望作曲家认识到使用 VendorNamespace 作为包的供应商部分指向特定的 GitHub 帐户,而不是为我的每个特定包重复上述条目想要包括。

不幸的是,你不能这样做。

一种解决方案是使用 Private Packagist, or to boot up your own instance of packagist.org site which is open source: https://github.com/composer/packagist,然后它将托管您自己的私人包。