Download the PHP package horde/version without Composer
On this page you can find all versions of the php package horde/version. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download horde/version
More information about horde/version
Files in horde/version
Package version
Short Description Handle Semantic Version 2.0.0 format and similar semantic version formats
License LGPL-2.1-only
Homepage https://www.horde.org
Informations about the package version
horde/version
Create, parse, increment, compare, and constrain strict SemVer V2 version tags and other common semantic versioning formats found in the wild.
Features
- ✅ Parse strict SemVer 2.0 and relaxed variants
- ✅ Compare versions with full SemVer 2.0 precedence rules
- ✅ Generate next versions (patch/minor/major bumps)
- ✅ Detect and manage stability levels (dev/alpha/beta/rc/stable)
- ✅ Version constraints (Composer-compatible syntax)
- ✅ Collection utilities (sort, filter, find latest)
- ✅ Comprehensive test coverage (193 tests, 592 assertions)
Installation
Quick Start
Parsing Versions
Comparing Versions
Version Constraints
Collection Utilities
Generating Next Versions
Stability Detection
Motivation
SemVer V2 is a useful attempt to standardize semantic versioning. However, semantic versioning itself predates it, and many variant formats exist in the wild.
Common SemVer Deviations
- Stability order: Treating "dev" as inferior to "alpha" (SemVer says alpha < beta < dev < rc)
- No hyphen: Prerelease without hyphen (
1.0.0alpha1instead of1.0.0-alpha.1) - Missing patch: Version strings with only major.minor (
1.0instead of1.0.0) - Prefixes:
vprefix before version (v1.0.0) - Prerelease format:
alpha4more common thanalpha.4
This library handles both strict SemVer 2.0 and these common variants.
Use Cases
Dependency Management
Update Checker
Release Management
API Documentation
Core Classes
SemVerV2Version- Strict SemVer 2.0.0 parserRelaxedSemanticVersion- Lenient parser for common variantsGenericVersion- Any version stringSemVerV2Comparison- Compare versions per SemVer rulesNextVersion- Generate next version with bumpsStability- Detect and classify stability levels
Constraint System
VersionConstraint- Interface for all constraintsConstraintParser- Parse constraint stringsExactConstraint- Exact version matchComparisonConstraint->,>=,<,<=,!=CaretConstraint-^1.2.3rangesTildeConstraint-~1.2.3rangesWildcardConstraint-1.0.*patternsCompositeConstraint- AND/OR logic
Utilities
VersionCollection- Sort, filter, find versionsVersionComparable- Helper methods trait
Requirements
- PHP 8.2 or higher
- No external dependencies
Testing
Test coverage: 193 tests, 592 assertions
License
LGPL-2.1-only - See LICENSE file
Contributing
This library is part of the Horde project. Contributions welcome!
Origin
Originally extracted from the horde/components developer CLI tool, rewritten for general-purpose use.