Download the PHP package iodigital-com/composer-semver-cli without Composer

On this page you can find all versions of the php package iodigital-com/composer-semver-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-semver-cli

Composer SemVer CLI

A CLI wrapper around the composer/semver package. Command namespaces are added for representing most methods of the Composer\Semver\Comparator, Composer\Semver\Semver and Composer\Semver\VersionParser classes.

Installation

Add the package as a requirement to your project:

$ composer require iodigital-com/composer-semver-cli

This will install the composer-semver script to the vendor/bin folder of the project.

Or as a global requirement:

$ composer global require iodigital-com/composer-semver-cli

This will install the composer-semver script to the $HOME/.composer/vendor/bin folder.

Usage

The following commands are provided:

Examples

Check whether a version is greater than another version:

$ composer-semver -v comparator:gt '1.25.0-alpha1' 'v1.24.0-p1'
version '1.25.0-alpha1' is greater than version 'v1.24.0-p1' according to Composer SemVer

Sort versions:

$ composer-semver semver:sort '1.25.0' 'v1.25.0-p2' '1.25.0-rc3' 'v1.25-dev'
v1.25-dev
1.25.0-rc3
1.25.0
v1.25.0-p2

Check if a version is satisfied by a Composer SemVer constraint:

$ composer-semver semver:satisfies -v '^1.25.0-p1' 'v1.25-p2'
Composer SemVer constraint '^1.25.0-p1' satisfies version 'v1.25-p2'

Check which versions are satisfied by a Composer SemVer constraint:

$ composer-semver semver:satisfied-by '^1.25.0-p1' '1.25.0' 'v1.25.0-p2' '1.25.0-rc3' 'v1.25-dev'
v1.25.0-p2

Return stability of a version:

$ composer-semver version-parser:parse-stability '1.25.0-rc3'
RC

Applications

This tool allows for Composer SemVer calculations where using the Composer tool itself would be impractical.

For instance, to prepare for a PHP upgrade, it is nice to know upfront if the new version introduces any incompatibilities with the require.php property of the packages in the vendor folder. This can be done using the check-platform-reqs Composer command; however, this the Composer command is actually run in the context of the new PHP version. When this is not possible, the following command can be used to generate a list of packages that are incompatible with a specific PHP version (in this case 8.3.0):

$ for f in vendor/*/*/composer.json ; do if jq -e '.require.php' $f > /dev/null && ! composer-semver semver:satisfies "$(jq -r '.require.php' $f)" '8.3.0' ; then echo $f ; fi ; done

Note that this makes use of the jq command.

As another application, you might want to check how Composer sees the git tags of your application. For instance, you can sort them according to Composer SemVer:

$ composer-semver semver:sort $(git tag -l)

Or check which tags satisfy a Composer SemVer constraint:

$ composer-semver semver:satisfied-by "^1.2" $(git tag -l)

Or you might want to know how many stable versions have been released:

$ for VERSION in $(git tag -l) ; do composer-semver version-parser:parse-stability ${VERSION} ; done | grep -c "stable"

All versions of composer-semver-cli with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
composer/semver Version ^3.4
symfony/console Version ^6.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iodigital-com/composer-semver-cli contains the following files

Loading the files please wait ....