Download the PHP package tourze/quic-core without Composer
On this page you can find all versions of the php package tourze/quic-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package quic-core
QUIC Core Package
中文
QUIC协议核心基础库,提供QUIC协议的核心枚举、常量、工具类和异常处理机制。
目录
- 功能特性
- 安装
- 快速开始
- 规范遵循
- 架构设计
- 测试
- 开发
- 性能
- 贡献
- 许可证
功能特性
🎯 核心枚举
- QuicError - QUIC错误码枚举,包含所有RFC 9000定义的错误类型
- ConnectionState - 连接状态管理,支持状态转换验证
- FrameType - 帧类型定义,包含完整的帧特性判断方法
- PacketType - 包类型枚举,支持长/短包头判断
- StreamSendState/StreamRecvState - 流状态机实现
- StreamType - 流类型识别(双向/单向,客户端/服务端)
- TLSState - TLS握手状态枚举
- ECNState - ECN功能状态枚举
- PathState - 路径验证状态枚举
🛠️ 工具类
- VariableInteger - 变长整数编解码器,完全符合RFC 9000规范
- ConnectionId - 连接ID生成器和管理工具
- Constants - 完整的QUIC协议常量定义
⚠️ 异常处理
- QuicException - 基础异常类,集成QUIC错误码
- ConnectionException - 连接层异常
- StreamException - 流层异常
- FrameException - 帧处理异常
- CryptoException - 加密层异常
安装
快速开始
变长整数编解码
连接ID管理
错误处理
枚举使用
常量使用
规范遵循
本包严格遵循以下规范:
- 📋 RFC 9000 - QUIC: A UDP-Based Multiplexed and Secure Transport
- 🔐 RFC 9001 - Using TLS to Secure QUIC
- 🛡️ RFC 9002 - QUIC Loss Detection and Congestion Control
- 📝 PSR-1 - Basic Coding Standard
- 🏗️ PSR-4 - Autoloader Standard
- ✨ PSR-12 - Extended Coding Style
架构设计
设计原则
- 第一性原理 - 从QUIC协议本质出发设计
- SOLID原则 - 单一职责、开闭原则、里式替换等
- DRY原则 - 避免重复代码
- KISS原则 - 保持简单易懂
- YAGNI原则 - 只实现需要的功能
包结构
测试
运行所有测试:
测试统计:
- ✅ 186个测试 全部通过
- ✅ 898个断言 全部成功
- 📊 100% 核心功能覆盖
开发
环境要求
- PHP 8.1+
- ext-mbstring
开发依赖
- PHPUnit 10.0+ (测试框架)
- PHPStan 2.1+ (静态分析)
代码风格
本项目遵循PSR-12编码标准,并有以下额外规范:
- 使用PHP 8.1+特性(枚举、readonly属性等)
- 中文注释说明
- 严格类型声明
- 完整的PHPDoc注释
性能
基准测试
VariableInteger编解码性能(10,000次迭代):
- 编码:< 0.1秒
- 解码:< 0.1秒
- 往返转换:< 0.2秒
内存使用
- 枚举类:零运行时开销
- 工具类:最小内存占用
- 异常类:继承标准Exception
贡献
欢迎提交Issue和Pull Request!
开发流程
- Fork本仓库
- 创建特性分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启Pull Request
提交规范
- 🎯 feat: 新功能
- 🐛 fix: 修复bug
- 📚 docs: 文档更新
- 🎨 style: 代码格式调整
- ♻️ refactor: 重构代码
- ✅ test: 添加测试
- 🔧 chore: 构建工具等
许可证
MIT License
相关链接
注意: 这是一个基础库,提供QUIC协议的核心类型和工具。完整的QUIC实现需要配合其他协议层包使用。
All versions of quic-core with dependencies
PHP Build Version
Package Version
Requires
ext-ctype Version
*
ext-hash Version *
ext-mbstring Version *
tourze/arrayable Version 1.*
tourze/enum-extra Version 1.0.*
ext-hash Version *
ext-mbstring Version *
tourze/arrayable Version 1.*
tourze/enum-extra Version 1.0.*
The package tourze/quic-core contains the following files
Loading the files please wait ...