dousongqiang2585 2014-07-29 09:02
浏览 59
已采纳

标记作曲家包更新

I have a PHP composer package that requires "illuminate/support":"4.1.*" for use with Laravel 4.1 integration. I have a new Laravel project that is now at v 4.2.*. I believe I now need to update the package to require "illuminate/support":"4.2.*" (due to composer errors). How best do I maintain support for Laravel v4.1 and v4.2 in the package?

Here is my composer package's composer.jsonfile:

{
    "name": "appointedd/appointedd-php",
    "description": "",
    "authors": [
        {
            "name": "Billy Jones",
            "email": "billy@appointedd.com"
        }
    ],
    "require": {
        "php": ">=5.3.0",
        "illuminate/support": "4.1.*",
        "guzzlehttp/guzzle": "~4.0"
    },
    "autoload": {
        "psr-0": {
            "Appointedd\\Appointedd": "src/"
        }
    },
    "minimum-stability": "stable"
}

It's currently tagged at version 0.0.3. Should I update the composer.json file to require 4.2.* and tag it 0.1.0 or use a more meaningful name?

  • 写回答

1条回答 默认 最新

  • doujiao4710 2014-07-29 09:23
    关注

    The question is what differences are between 4.1 and 4.2 that you need to support it differently. Semantic versioning should guarantee that newer minor version only introduces BC-compatible features and bug fixes.

    As for your question, you can include version range in your composer.json file, as described here:

    Range >=1.0 >=1.0,<2.0 >=1.0,<1.1 | >=1.2 By using comparison operators you can specify ranges of valid versions. Valid operators are >, >=, <, <=, !=. You can define multiple ranges, separated by a comma, which will be treated as a logical AND. A pipe symbol | will be treated as a logical OR. AND has higher precedence than OR.

    In your situation, it would be something like:

    "illuminate/support": ">=4.1.0,<4.3",
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 这个复选框什么作用?
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决