drupify/version-resolver
Composer 安装命令:
composer require drupify/version-resolver
包简介
A PHP library for resolving version, supported releases etc. for Drupal Core, modules, themes, and other related projects.
README 文档
README
Drupal Version Resolver Library
The Drupal Version Resolver Library is a PHP library designed to help you easily resolve Drupal project versions, supported releases, and retrieve all releases hosted on Drupal.org. Whether you need to fetch release information for Drupal core or contributed modules/themes, this library offers a simple API to access such data.
Features
- Fetch supported releases for a given Drupal module or theme.
- Get all available releases for any Drupal project.
- Resolve different Drupal core versions, including the current version, development versions, and next minor versions.
Requirements
- PHP 8.1 and above.
- Composer for installation.
- Internet access to query data from drupal.org.
Installation
To install, you can run below command:
composer require drupify/version-resolver
Example Usage
Here’s an example to retrieve the releases of a module hosted on Drupal.org:
use Drupify\Resolver\VersionResolver; // Initialize the resolver with the project name. $resolver = new VersionResolver('token'); // Get supported releases for the project. $supported = $resolver->getSupportedReleases(); // Output format example: [ "8.x-1.x" => [ "stable" => [ "name" => "token 8.x-1.15", "version" => "8.x-1.15", "tag" => "8.x-1.15", "core_compatibility" => "^9.2 || ^10 || ^11" ], "dev" => [ "name" => "token 8.x-1.x-dev", "version" => "8.x-1.x-dev", "tag" => "8.x-1.x", "core_compatibility" => "^9.2 || ^10 || ^11" ] ] ]
Fetching All Releases
If you need to retrieve all releases (including older versions), you can do so with the following:
$all = $resolver->getAllReleases();
Note: This method returns all releases, but it does not include projects compatible with Drupal Core 7.x and below.
Resolving Drupal Core Versions
The library also provides methods to resolve various types of Drupal core versions:
- Current Stable: Returns the current stable version (e.g.,
10.3). - Current Dev: Returns the current development version (e.g.,
10.3.x-dev). - Next Minor: Returns the next minor version (e.g.,
11.0.0-rc1). - Next Minor Dev: Returns the next minor development version (e.g.,
11.0.x-dev) and so on.
Example usage:
use Drupify\Resolver\CoreVersionResolver; $resolver = new CoreVersionResolver(); $currentVersion = $resolver->findCurrent(); $currentDevVersion = $resolver->findCurrentDev(); $nextMinorVersion = $resolver->findNextMinor(); $nextMinorDevVersion = $resolver->findNextMinorDev();
Example Output
echo $currentVersion; // 10.3 echo $currentDevVersion; // 10.3.x-dev echo $nextMinorVersion; // 11.0.0-rc1 echo $nextMinorDevVersion; // 11.0.x-dev
Contact
If you have any questions or issues, feel free to open a GitHub issue or contact the maintainers directly.
drupify/version-resolver 适用场景与选型建议
drupify/version-resolver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 「PHP Library」 「version resolver」 「drupal library」 「drupal version resolver」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 drupify/version-resolver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drupify/version-resolver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 drupify/version-resolver 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
This module extends Drupal Migrate framework.
Inbox pattern process implementation for your Laravel Applications
Installs and configures the WissKI base environment with mandatory modules.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-22