问题描述
我刚刚开始在 PHPStorm 中使用 composer,因为我厌倦了手动从 github 下载依赖项.但是有些事情我无法理解.
I've just started using composer with PHPStorm 'cause I'm bored of downloading dependencies from github manually. But there are some things I can't understand.
Composer 总是将文件下载到 /vendor 文件夹中.就像我添加 Twitter Bootstrap - 它将被下载到 /vendor/twitter/bootstrap 文件夹.但我需要它进入我的 /webroot/bootstrap/ 目录.你如何移动这些文件?因为如果我手动移动它 - 它们以后不会使用 composer update 命令更新.
Composer always downloads files into /vendor folder. Like if I add Twitter Bootstrap - it will be downloaded to /vendor/twitter/bootstrap folder. But I need it to be into my /webroot/bootstrap/ directory. How do you move this files? Because if I move it manually - they won't be updated later using composer update command.
或者,如果我使用 micro php framevork slim.我添加了 slim/slim 依赖项.但是会被放到 /vendor/slim/slim/...
Or if I use micro php framevork slim. I've added slim/slim dependency. But it will be placed into /vendor/slim/slim/...
那我该怎么办?使用 Phing 或其他一些部署工具将文件从/vendor 移动到所需的目的地?你用什么?
So what should I do? Use Phing or some other deployment tool to move files from /vendor to desired destination? What do you use?
这并不完全是我需要的,但它适用于 css/js/etc.http://www.phpclasses.org/blog/package/8429/post/1-Using-Composer-to-Install-JavaScript-CSS-and-Images-Under-the-Web-Document-Directory.html
That's not exactly whar I need, but it works for css/js/etc. http://www.phpclasses.org/blog/package/8429/post/1-Using-Composer-to-Install-JavaScript-CSS-and-Images-Under-the-Web-Document-Directory.html
推荐答案
"config": {
"vendor-dir": "path/to/wherever"
},
在您的 composer.json 文件中
in your composer.json file
这篇关于Composer,从/vendor/文件夹中移动文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!