OXIESEC PANEL
- Current Dir:
/
/
opt
/
.wp-cli
/
packages
/
vendor
/
composer
/
semver
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/20/2024 11:17:29 AM
rwxr-xr-x
📁
.git
-
09/06/2025 12:29:47 PM
rwxr-xr-x
📄
.gitattributes
768 bytes
02/24/2025 12:05:13 PM
rw-r--r--
📁
.github
-
02/24/2025 12:05:13 PM
rwxr-xr-x
📄
.gitignore
62 bytes
03/20/2024 11:17:26 AM
rw-r--r--
📄
.php_cs
1.88 KB
03/20/2024 11:17:26 AM
rw-r--r--
📄
CHANGELOG.md
9.85 KB
02/24/2025 12:05:13 PM
rw-r--r--
📄
CONTRIBUTING.md
1 KB
03/20/2024 11:17:26 AM
rw-r--r--
📄
LICENSE
1.03 KB
03/20/2024 11:17:26 AM
rw-r--r--
📄
README.md
3.32 KB
03/20/2024 11:17:26 AM
rw-r--r--
📄
composer.json
1.47 KB
02/24/2025 12:05:13 PM
rw-r--r--
📄
phpstan-baseline.neon
474 bytes
03/20/2024 11:17:26 AM
rw-r--r--
📄
phpstan.neon.dist
426 bytes
03/20/2024 11:17:26 AM
rw-r--r--
📄
phpunit.xml.dist
530 bytes
03/20/2024 11:17:26 AM
rw-r--r--
📁
src
-
09/06/2025 12:29:47 PM
rwxr-xr-x
📁
tests
-
09/06/2025 12:29:47 PM
rwxr-xr-x
Editing: README.md
Close
composer/semver =============== Semver (Semantic Versioning) library that offers utilities, version constraint parsing and validation. Originally written as part of [composer/composer](https://github.com/composer/composer), now extracted and made available as a stand-alone library. [](https://github.com/composer/semver/actions/workflows/continuous-integration.yml) [](https://github.com/composer/semver/actions/workflows/lint.yml) [](https://github.com/composer/semver/actions/workflows/phpstan.yml) Installation ------------ Install the latest version with: ```bash composer require composer/semver ``` Requirements ------------ * PHP 5.3.2 is required but using the latest version of PHP is highly recommended. Version Comparison ------------------ For details on how versions are compared, refer to the [Versions](https://getcomposer.org/doc/articles/versions.md) article in the documentation section of the [getcomposer.org](https://getcomposer.org) website. Basic usage ----------- ### Comparator The [`Composer\Semver\Comparator`](https://github.com/composer/semver/blob/main/src/Comparator.php) class provides the following methods for comparing versions: * greaterThan($v1, $v2) * greaterThanOrEqualTo($v1, $v2) * lessThan($v1, $v2) * lessThanOrEqualTo($v1, $v2) * equalTo($v1, $v2) * notEqualTo($v1, $v2) Each function takes two version strings as arguments and returns a boolean. For example: ```php use Composer\Semver\Comparator; Comparator::greaterThan('1.25.0', '1.24.0'); // 1.25.0 > 1.24.0 ``` ### Semver The [`Composer\Semver\Semver`](https://github.com/composer/semver/blob/main/src/Semver.php) class provides the following methods: * satisfies($version, $constraints) * satisfiedBy(array $versions, $constraint) * sort($versions) * rsort($versions) ### Intervals The [`Composer\Semver\Intervals`](https://github.com/composer/semver/blob/main/src/Intervals.php) static class provides a few utilities to work with complex constraints or read version intervals from a constraint: ```php use Composer\Semver\Intervals; // Checks whether $candidate is a subset of $constraint Intervals::isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint); // Checks whether $a and $b have any intersection, equivalent to $a->matches($b) Intervals::haveIntersections(ConstraintInterface $a, ConstraintInterface $b); // Optimizes a complex multi constraint by merging all intervals down to the smallest // possible multi constraint. The drawbacks are this is not very fast, and the resulting // multi constraint will have no human readable prettyConstraint configured on it Intervals::compactConstraint(ConstraintInterface $constraint); // Creates an array of numeric intervals and branch constraints representing a given constraint Intervals::get(ConstraintInterface $constraint); // Clears the memoization cache when you are done processing constraints Intervals::clear() ``` See the class docblocks for more details. License ------- composer/semver is licensed under the MIT License, see the LICENSE file for details.