einenlum/composer-version-parser
最新稳定版本:1.0.1
Composer 安装命令:
composer require einenlum/composer-version-parser
包简介
A library to extract the potential higher version of a package from Composer requirements
README 文档
README
This small library allows to parse the version requirements from a composer.json file, allowing to get the probable version of a package (useful when no composer.lock is present).
Examples:
| Input | Output |
|---|---|
v1.0.* |
1.0 |
1.0.* |
1.0 |
^3.* |
3 |
^3.4.* |
3.4 |
^3.4 |
3 |
^3.4.9 |
3.4 |
~3 |
3 |
~3.4 |
3 |
~3.4.9 |
3.4 |
3 |
3 |
3.4 |
3.4 |
3.4.9 |
3.4.9 |
3.* |
3 |
3.4.* |
3.4 |
v3 |
3 |
v3.4 |
3.4 |
v3.4.9 |
3.4.9 |
v3.* |
3 |
v3.4.* |
3.4 |
* |
null |
More complex cases are not handled for now.
| Input | Output |
|---|---|
>1.0.* |
null |
>=1.0 |
null |
>=1.0 || 8.* |
null |
>=1.0; <2.0 |
null |
Install
composer require einenlum/composer-version-parser
Usage
<?php require_once __DIR__ . '/vendor/autoload.php'; use Einenlum\ComposerVersionParser\Parser; $parser = new Parser(); $parser->parse('v3.4.*'); // '3.4'
统计信息
- 总下载量: 1.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-13