composer.json中的secure-http标志不起作用 [英] secure-http flag in a composer.json doesn't work

查看:111
本文介绍了composer.json中的secure-http标志不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对几个软件包使用http composer注册表:

I need to use http composer registry for several packages:

...
"repositories":[
  {"type":"composer", "url":"http://<url>"}
],
"secure-http":false,
...

但是当我尝试作曲家更新更新锁定文件,我得到:

But when I am trying to composer update to update lock file, I got:

[Composer\Downloader\TransportException]
Your configuration does not allow connection to http://<url>.
See https://getcomposer.org/doc/06-config.md#secure-http for details.

通过响应url,我找到了下一个信息;

By responding url I found next information;

secure-http#

Defaults to true. 
If set to true only HTTPS URLs are allowed to be downloaded via Composer. 
If you really absolutely need HTTP access to something then you can disable it ...

所以我很困惑我在做什么错。

So I am confused what I am doing wrong.

推荐答案

错误的 composer.json 结构。 安全HTTP 必须位于 config 部分:

Wrong composer.json structure. secure-http must be in the config section:

{
  ...,
  "config":{
    ...,
    "secure-http":false,
    ...
  }
  ...
}

这篇关于composer.json中的secure-http标志不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆