skip to Main Content

Hi I would like to update a semantic version number using php for a three digit system in string form.
An example :

'1.0.0' => function => '1.0.1'
'1.0.12' => function => '1.0.13'

Does anyone know a solution to this problem?
Thanks in advance

2

Answers


  1. All the answers you want for the semantic-versioning is you can get in,

    PHLAK/SemVer

    Composer also have the library for the same but the methods are easy from SemVer.

    Login or Signup to reply.
  2. Using the following code snippet for this:

        $parts = explode('.', $previousTag, 3);
        $newTag = $parts[0] . '.' . $parts[1] . '.' . (++$parts[2]);
    

    Ignoring here edge cases for alpha, beta, rc, … releases.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search