Download the PHP package hyperf-plus/route without Composer

On this page you can find all versions of the php package hyperf-plus/route. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package route

HPlus Route 4.0

PHP Version Hyperf Version

为 Hyperf 框架打造的智能 RESTful 路由组件,支持自动路径生成、智能参数识别、kebab-case URL 规范。

✨ 4.0 新特性

⚠️ 破坏性变更: URL 命名从 snake_case 改为 kebab-case,老用户请勿直接升级。

📦 安装

🚀 快速开始

基础 CRUD

资源子操作

自定义路径

📋 RESTful 映射规则

标准方法

方法名 HTTP 路径 说明
index / list GET / 获取列表
show / detail GET /{id} 获取详情
create / store POST / 创建资源
update / edit PUT /{id} 更新资源
patch PATCH /{id} 部分更新
delete / destroy DELETE /{id} 删除资源
search GET /search 搜索
export GET /export 导出
import POST /import 导入
batch POST /batch 批量操作

驼峰转 kebab-case

🎯 注解说明

@ApiController

@GetApi / @PostApi / @PutApi / @DeleteApi / @PatchApi

参数注解

🛠️ 高级用法

路由收集器

版本控制

🤝 与其他组件集成

与 HPlus Validate 集成

与 HPlus Swagger 集成

路由信息自动被 Swagger 组件识别,生成 API 文档。

🧪 测试覆盖

运行测试:

📊 与 3.x 版本对比

特性 3.x 4.0
URL 风格 snake_case kebab-case
依赖 validate 软依赖 完全独立
智能映射规则 30+ 条 13 条核心
Hyperf 3.1 部分支持 完整支持
路由优先级 无 静态路由优先
PHP 版本 8.0+ 8.1+

🔄 从 3.x 迁移到 4.0

⚠️ 重要警告:4.0 有破坏性变更,不建议老项目直接升级。如确需升级,请仔细阅读以下内容。

破坏性变更清单

1. URL 命名风格变更(影响最大)

3.x: snake_case 4.0: kebab-case

方法名转换:

2. RESTful 映射精简

移除的映射(4.0 将回退为 kebab-case 路径):

3.x 方法 3.x 路径 4.0 路径
all / /all
find /{id} /find
first /{id} /first
save / /save
put /{id} /put

保留的核心映射:

3. PHP 版本要求

4. Hyperf 版本要求

5. 注解参数变更

deprecated 类型变更:

6. 路由优先级

4.0 新增路由优先级排序,静态路由优先于动态路由注册:

迁移步骤

步骤 1:检查 PHP 和 Hyperf 版本

步骤 2:备份现有路由

步骤 3:升级依赖

步骤 4:修改前端 API 调用

方案 A:修改前端(推荐)

方案 B:使用显式路径保持兼容

步骤 5:检查自定义方法

步骤 6:运行测试验证

不迁移建议

如果你的项目满足以下条件,建议保持 3.x 版本:

快速兼容方案

如果必须升级但不想改 URL,在 config/autoload/route.php 添加:


📄 License

MIT


All versions of route with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
hyperf/config Version ^3.1
hyperf/di Version ^3.1.0
hyperf/framework Version ^3.1.0
hyperf/http-server Version ^3.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hyperf-plus/route contains the following files

Loading the files please wait ...