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 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100