dongwei5740 2015-04-21 13:16
浏览 38

作曲家 - 同时处理项目和依赖

I have a project that contains a subproject. They are in separate repositories.

In a production environment the subproject would be a dependency of the main project declared in the composer.json file.

In my development environment I would like to able to work with both projects at the same time. I don't want to composer update my subproject everytime I modify it.

At the moment I have my subproject included in a subfolder of the main project which is .gitignored, in such a way that it is not seen from the main repository but it is seen by the application. This approach poses a series of problems, like:

  • I need to have differente compose.json in development and in production
  • In developmente I need to load the dependencies if the subproject through the composer.json of the main project

Is there a way to make composer handle this situation all by itself? Is there some better solution to do this?

  • 写回答

1条回答 默认 最新

  • duanchi6397 2015-04-23 21:32
    关注

    I don't think there is a perfect solution. The best you can do is to change the version number of your sub-project to the branch you are working on (such as dev-master) and run composer update. You can then work directly in the sub-project code in your vendor directory. You can even commit and push your code from there. The downside is that you have to be careful when you commit your composer.json and composer.lock files because of the manual dev-only changes. Changes to those files don't happen terribly often, so it's not too bad.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大