Php composer配置添加不带名称的存储库位置

Php composer配置添加不带名称的存储库位置,php,composer-php,repository,command-line-interface,config,Php,Composer Php,Repository,Command Line Interface,Config,是否有任何方法可以使用composer CLI命令将存储库位置添加到composer.json,但不说明其名称 你可以做: composer config repositories.<name> vcs /path/to/the/repository 我有兴趣添加这样的条目: { "type": "vcs", "url": "https://github.com/igorw/monolog" } 通过

是否有任何方法可以使用composer CLI命令将存储库位置添加到
composer.json
,但不说明其名称

你可以做:

composer config repositories.<name> vcs /path/to/the/repository
我有兴趣添加这样的条目:

        {
            "type": "vcs",
            "url": "https://github.com/igorw/monolog"
        }
通过使用composer CLI命令,但是:

composer config repositories vcs /path/to/the/repository
失败了


你知道怎么做吗?

现在不可能。如果查看解析
存储库
参数(或repo/repos)的正则表达式:

您可以看到它需要
repositories.name
格式。我的猜测是,如果您还没有定义存储库,那么匿名添加它们就可以了,但如果您开始尝试命名其中的一些存储库,它就会崩溃。另外,
unset
命令也不起作用,因为您尚未命名它,重复运行该命令将继续添加它们


我的猜测是,不支持这一点是故意的。您可以随时在存储库中打开一个问题来请求它。

我找不到这样做的方法。我只需要手动添加它(不使用cli工具)。我确实尝试过使用
composer配置存储库。vcs/url
。它起作用了,但它显然将名称设置为“_uz”。然后你可以进去把它删除。但是,如果您正在这样做,您也可以手动添加它

composer config repositories vcs /path/to/the/repository
// handle repositories
if (preg_match('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) {