doucheng7808 2014-12-09 20:45
浏览 60

如何将我的本地文件系统设置为我的开发环境的composer存储库?

I usually use Java to make IT projects with Maven as Dependency Management (DM). By requirements I have to implement DM in the company that I work in some projects made in PHP. One of the requirements is that they don't want to use any type of framework as symfony, laravel, zend, etc.

I was investigating some DM for PHP and found that the best option is Composer. I'm working on multilayer projects, something like that:

  • Core
  • Services
  • Client
  • Site

When I started to make this structure the first issue that I found is that Composer doesn't retrieve recursive dependencies, for that reason, I implemented Satis as Package Repository. I used Satis and not Packagist is because the projects are private projects and this implement SVN as Version Control System, and Packagist used GitHub for retrieve the source code of the projects.

After explain all implementation about that I done, I found some obstacles to follow with development of my multilayer structure.

  1. For example, if I modify the Core project, to reflect those changes I have to make a commit into SVN, after that, refresh Satis Repository, and finally update the project where I'm using the Core. For that reason I have tried to find some way to point the dependencies to my filesystem to avoid commit every time, and just commit when the feature, bug, fix is done.

My satis.json looks like

{
    "name": "My Repository",
    "homepage": "https://www.myrepository.com/",
    "repositories": [
        { "type": "vcs", "url": "file:///C:/core/branches/core/" },
        { "type": "vcs", "url": "file:///C:/services/branches/services/" }
    ],
    "require-all": true
}

Thanks for your help.

  • 写回答

2条回答 默认 最新

  • duanlu1279 2014-12-09 21:12
    关注

    Satis does not accept file URLs to grap stuff from, but you can point to the SVN repository directly in your root project's composer.json (because, as you already found out, Composer does not resolve these repositories recursively).

    You don't have to depend on the package that is provided in this repository directly, you only have to mention it to make it available for updating stuff.

    评论

报告相同问题?

悬赏问题

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