roadrunner-php/version-checker
Composer 安装命令:
composer require roadrunner-php/version-checker
包简介
The package for checking the version of the RoadRunner
README 文档
README
Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.0+
Installation
You can install the package via composer:
composer require roadrunner-php/version-checker
Usage
Use the RoadRunner\VersionChecker\VersionChecker methods to check the compatibility of the installed RoadRunner
version. The VersionChecker class has three public methods:
- greaterThan - Checks if the installed version of RoadRunner is greater than or equal to the specified version.
If no version is specified, the minimum required version will be determined based on the minimum required version of
the
spiral/roadrunnerpackage. - lessThan - Checks if the installed version of RoadRunner is less than or equal to the specified version.
- equal - Checks if the installed version of RoadRunner is equal to the specified version.
All three methods throw an RoadRunner\VersionChecker\Exception\UnsupportedVersionException if the installed version
of RoadRunner does not meet the specified requirements. If RoadRunner is not installed, a
RoadRunner\VersionChecker\Exception\RoadrunnerNotInstalledException is thrown.
use RoadRunner\VersionChecker\VersionChecker; use RoadRunner\VersionChecker\Exception\UnsupportedVersionException; $checker = new VersionChecker(); try { $checker->greaterThan('2023.1'); } catch (UnsupportedVersionException $exception) { var_dump($exception->getMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2023.1` or higher. var_dump($exception->getInstalledVersion()); // 2.12.3 var_dump($exception->getRequestedVersion()); // 2023.1 } try { $checker->lessThan('2.11'); } catch (UnsupportedVersionException $exception) { var_dump($exception->getMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2.11` or lower. var_dump($exception->getInstalledVersion()); // 2.12.3 var_dump($exception->getRequestedVersion()); // 2.11 } try { $checker->equal('2.11'); } catch (UnsupportedVersionException $exception) { var_dump($exception->getMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2.11`. var_dump($exception->getInstalledVersion()); // 2.12.3 var_dump($exception->getRequestedVersion()); // 2.11 }
Path to the RoadRunner binary
To configure the VersionChecker to search for the RoadRunner binary in a location other than the default
(application root with a rr filename), you can bind the RoadRunner\VersionChecker\Version\InstalledInterface
within application container using the RoadRunner\VersionChecker\Version\Installed class and passing the desired
file path as the $executablePath parameter. After that, you can retrieve the VersionChecker class from
application container.
Example with Spiral Framework container:
use RoadRunner\VersionChecker\Version\InstalledInterface; use RoadRunner\VersionChecker\Version\Installed; $container->bindSingleton(InstalledInterface::class, new Installed(executablePath: 'some/path')); $checker = $container->get(VersionChecker::class);
Testing
composer test
composer psalm
composer cs
License
The MIT License (MIT). Please see License File for more information.
roadrunner-php/version-checker 适用场景与选型建议
roadrunner-php/version-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.53M 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 05 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「roadrunner」 「roadrunner-php」 「version-checker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 roadrunner-php/version-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roadrunner-php/version-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 roadrunner-php/version-checker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This package provides a PHP integration package for the RoadRunner Lock plugin, which allows for easy management of distributed locks in PHP applications. The plugin provides a fast, lightweight, and reliable way to acquire, release, and manage locks in a distributed environment, making it ideal for
RoadRunner: symfony/lock bridge
RoadRunner and Ubiquity integration
Make Codeigniter4 work on Roadrunner Server.
Supercharge your Lumen application's performance.
RoadRunner <-> Lumen Integration
统计信息
- 总下载量: 2.53M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 21
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-24