douyou1857 2018-09-16 12:29
浏览 62

自定义项目Composer全局指定的供应商路径,但与全局供应商路径不同

Since I am running a dev environment on a Vagrant machine (and the app I am working on runs way faster by not having the vendor directory in a shared folder), I need to specify a custom path for the location of the project's vendor directory.

I wouldn't want to specify the custom path in the composer.json configuration (with the "vendor-dir" parameter) as this would cause issues to other developers who are working on the project.

For now, I have resolved by setting the vendor parameter by exporting the COMPOSER_VENDOR_DIR environment variable in my .bash_profile.

However, the problem with this solution is that I now have conflicts when installing packages globally and also installing project specific packages. E.g. doing a composer install for my project will detect that the vendor directory contains dependencies that are not specified in the project manifest and therefore it removes them.

TL;DR Are there other ways to specify a project vendor path for my project (other than having to change the project's composer.json file) but still by not sharing the packages with the ones that are installed globally?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 数学建模,尽量用matlab回答,论文格式
    • ¥15 昨天挂载了一下u盘,然后拔了
    • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
    • ¥20 易康econgnition精度验证
    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能