doufei9946 2015-10-10 14:02
浏览 38
已采纳

嵌套目录的composer供应商名称格式

The standard package name format for a composer package is vendor/pkName. I've this following directory structure:

 - myVendorName

    - extensions
      - yii2
        -Ext1
        -Ext2 and so on

    - bundles
      - bundle1
      - bundle2
      - bundle3 and so on

    - toolkit
     - forlder1
     - folder2 and so on

This is the organization that I gave in my harddisk, but the real projects are like:

  - myVendorName/extensions/yii2/ext1
  - myVendorName/extensions/yii2/ext2
  - myVendorName/bundles/bundle1
  - myVendorName/bundles/bundle2
  - myVendorName/bundles/bundle3
  - myVendorName/toolkit

My questions about this:

  1. It's possible to store all in one git repository and require with composer only the needed subpackages (for example: require only myVendorName/toolkit and myVendorName/bundles/bundle3)

  2. It's possible to maintain the extended name format with composer (so in composer.json require section, require for myVendorName/bundles/bundle3 instead of myVendorName/bundle3)

Is there a way to achieve these 2 points?

  • 写回答

2条回答 默认 最新

  • dongxing7083 2015-10-10 15:39
    关注

    You can achieve (1) by using git subtree split. Using this method, you split seperate directories of the main repository into a new repository and push it to github. This way, all packages still have their own repository, but you only have to maintain one repository (lots of big projects use this, like Symfony, Laravel, etc.).

    (2) is not supported. You can use something like my_vendor/third-bundle instead of my_vendor/bundles/third. The directory isn't important anyways, as Composer will just perfectly autoload all classes inside the packages (if they have the correct autoloading config).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题