Download the PHP package jeffpacks/semver without Composer

On this page you can find all versions of the php package jeffpacks/semver. 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 semver

About

The VersionNumber class of this library represents a SemVer 2.0.0 semi-compliant version number. The class offers methods for querying the version number it represents as well as methods for comparison and manipulation.

The VersionRange class represents a range a version number falls inside or outside of. It currently only offers caret range support.

Requirements

This library requires PHP 7.4/8.0 and jeffpacks/substractor.

Installing

Run composer require jeffpacks/semver in your project's root directory and use \jeffpacks\semver\VersionNumber in your PHP script/class.

If you don't want to use Composer or its classloader and have downloaded this library, you may use the built-in classloader instead:

Code examples

Semantic Versioning compliance

This library supports some formats that are not covered by SemVer 2.0.0, but lacks support for other esoteric formats that SemVer defines. The most important one is that while SemVer 2.0.0 defines the version core MAJOR.MINOR.PATCH, MINOR and PATCH are optional in this library. You may work with version numbers consisting of a MAJOR segment only or a MAJOR.MINOR format. Furthermore, the library also supports a fourth optional segment known as the AUX segment. Use it for whatever floats your boat.

This library does not yet support the flexible pre-release segment format specified in SemVer 2.0, but is currently limited to the following format (Backus–Naur form grammar):

In short, beta, beta.1, beta.25 etc are allowed pre-release segments, but not beta.0, beta.1.13 etc.

Zero-major segment interpretation

A version number with a MAJOR segment set to 0 is interpreted by this library as a non-stable version, on par with an ALPHA or BETA version. Here are some of the allowed combinations:

Which of 0.0.0 and 0.0.0-alpha.1 is higher is not addressed by SemVer 2.0.0, so the rule of thumb for this library is that a version number without a pre-release segment (alpha.1 in this case) is always considered higher than a version number with a pre-release segment. In short, 0.0.0 > 0.0.0-beta.1 > 0.0.0-alpha.1.

Comparison

This library provides methods for comparing version numbers of different version core formats. The comparison is done based on the following rules:

  1. the numeric value of the version number (e.g. 2.1 has a higher numeric value than 1.3)
  2. the number of segments in the version core (e.g 1.2 is lower than 1.2.0)
  3. the presence of a pre-release number (e.g. 1.2.3-beta is lower than 1.2.3-beta.1)

Authors

License

MIT License


All versions of semver with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0|^8.1
jeffpacks/substractor Version ^2.1
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 jeffpacks/semver contains the following files

Loading the files please wait ....