定制 rokke/http 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rokke/http

Composer 安装命令:

composer require rokke/http

包简介

HTTP transport adapter for the Rokke Runtime — routes Swoole HTTP requests to compiled operations

README 文档

README

CI Latest Version PHP License

HTTP transport adapter for the Rokke Runtime.

What this is

rokke/http is not an HTTP framework — it is an HTTP adapter. It takes Swoole HTTP requests, resolves them against a compiled route tree, and dispatches them to the Rokke Runtime's ExecutionEngine. The Runtime never knows a URL existed. This package owns the entire HTTP boundary: route compilation, request parsing, context construction, and response emission.

Installation

composer require rokke/http

Requires PHP ≥ 8.4, ext-swoole ≥ 5.0, rokke/runtime ^0.7, and rokke/contracts ^0.4.

Architecture

Swoole HTTP Request
        ↓
    HttpHost
        ↓
 CompiledRouteTree        ← compiled at Build time, never rebuilt
        ↓
  OperationContext        ← path params + headers + body parsed here
        ↓
  ExecutionEngine         ← unchanged; knows nothing about HTTP
        ↓
  ResultEmitter           ← converts Operation result → Swoole Response
        ↓
Swoole HTTP Response

The CompiledRouteTree is registered in the Runtime's ArtifactRepository during the Build phase. At runtime, HttpHost retrieves it via $runtime->artifacts->get(CompiledRouteTree::class) — no direct coupling between the HTTP module and the Runtime internals.

When to use

Use rokke/http when you need an HTTP transport for a Rokke application. For CLI, queue, or gRPC transports, use the corresponding adapter packages instead.

Stability

Pre-1.0. API may change between minor versions. Pin to an exact minor version in production.

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固