为什么Composer会忽略composer.json中的installer-paths设置?

huangapple go评论69阅读模式
英文:

Why does composer ignore the installer-paths in composer.json?

问题

由于现有的公司政策,我必须在默认的 ./vendor 目录之外安装软件包,但Composer顽固地继续在默认的 ./vendor 目录下创建并安装所有内容。

根据常见问题中的说明,我有以下的 composer.json 内容:

"require": {
    "monolog/monolog": "*"
},
"extra": {
    "installer-paths": {
        "3rdparty/": ["type:library"]
    }
}

我预期这将在 ./3rdparty 下安装 monolog,但实际上没有。我漏掉了什么?

英文:

Due to an existing company policy, I have to install packages in a directory other than the default ./vendor but composer stubbornly continues to create the default ./vendor directory and install everything there.

As per the FAQ, I have the following composer.json contents:


  "require": {
    "monolog/monolog": "*"
  },
  "extra": {
    "installer-paths": {
      "3rdparty/": ["type:library"]
    }
  }
}
~   

I expected this to install monolog under ./3rdparty but it doesn't. What am I missing?

答案1

得分: 2

我认为可以使用此选项的包列表有限,FAQ 页面底部有一条注释:

> 注意:您不能使用此选项更改任何包的路径。这仅适用于需要 composer/installers 并使用它处理的自定义类型的包。

也许这个存储库可以解决问题?

英文:

I think the list of packages that can use this option is limited, there is a note at the bottom of this FAQ page :

> Note: You cannot use this to change the path of any package. This is only applicable to packages that require composer/installers and use a custom type that it handles.

Maybe this repository will do the trick ?

huangapple
  • 本文由 发表于 2023年7月10日 22:15:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654627.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定