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条)

报告相同问题?

悬赏问题

  • ¥15 ubuntu服务器配置dns域名后无法访问其他域名
  • ¥50 本人复制了一个关于股票指标的代码,但是运行失败,有没有人帮我解决一下
  • ¥50 用matlab和numeca做透平机械流体力学和热力学模拟 价格可议
  • ¥15 Unity3D WebView
  • ¥20 论文AlphaTensor复现(有偿)
  • ¥15 (有偿)在ANSYS中 .anf文件
  • ¥45 关于#芯片#的问题:组合逻辑电路设计
  • ¥15 基与机器学习和时间序列分析预测养老服务需求趋势
  • ¥100 求连续两帧图像在水平和垂直上偏移
  • ¥15 Verilog hdl密码锁设计