PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] Tagging composer package updates

 January 31, 2022     composer-php, git, php, versioning     No comments   

Issue

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?


Solution

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",


Answered By - Tomasz Kowalczyk
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing