使用 composer 在自定义目录中安装包 [英] Use composer to install bundle in custom directory

查看:17
本文介绍了使用 composer 在自定义目录中安装包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到已经有一个问题,但它没有回答这个问题

I see there is already a question but it did not answer the question

如何在 /src 目录中安装包?

How can I install a bundle in the /src directory?

我想这样做的原因是为了开发和部署,所以

Reason I would like to do this is for development and deployment, so

  • 我不必将 Symfony 的基本代码签入我的 subversion 存储库中
  • 我可以使用 Composer 来部署

查看 Composer 文档后,我确实遇到了这个问题:

Looking over the Composer docs some more I did come across this:

vendor-dir:默认为供应商.您可以将依赖项安装到如果您愿意,可以使用不同的目录.

vendor-dir: Defaults to vendor. You can install dependencies into a different directory if you want to.

我可以在 Bundle 级别设置它吗?还是用于整体安装?

Could I set this at a Bundle level? or is this for the overall install?

推荐答案

我知道这已经晚了,但万一有人在寻找我煞费苦心(几个小时)找到的答案:<代码>供应商目录

I know this is late, but in case anyone is searching for an answer that I painstakingly (hours and hours) found: vendor-dir

文档说:

通过设置这个变量,你可以让 composer 将依赖项安装到供应商以外的目录中

By setting this var you can make composer install the dependencies into a directory other than vendor

例子:

{
    "config": {
        "vendor-dir": "website/password/vendor/"
    }
}

来自 此文档这个文档

再次,希望能为其他人节省几个小时.

Again, hope to save anyone else a couple hours.

这篇关于使用 composer 在自定义目录中安装包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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