使用 composer 在自定义目录中安装 bundle [英] Use composer to install bundle in custom directory
问题描述
我看到已经有问题了,但没有回答问题
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.
我可以将其设置为捆绑级别吗?还是为了整体安装?
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 将依赖项安装到 vendor 以外的目录中
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 在自定义目录中安装 bundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!