codesaur/http-message
Composer 安装命令:
composer require codesaur/http-message
包简介
Цэвэр, минимал, объект хандалтат бүтэцтэй HTTP Message компонент (PSR-7)
关键字:
README 文档
README
Агуулга / Table of Contents
- Монгол | 2. English | 3. Getting Started
1. Монгол тайлбар
Цэвэр, минимал, объект хандалтат бүтэцтэй HTTP Message компонент (PSR-7).
codesaur/http-message нь codesaur ecosystem-ийн нэг хэсэг бөгөөд PHP-ийн PSR-7 стандартын дагуу Request, Response, ServerRequest, URI, Stream, UploadedFile, OutputBuffer зэрэг HTTP мессежийн бүрэлдэхүүнүүдийг хэрэгжүүлсэн бага жинтэй компонент юм.
Багц нь дараах үндсэн классуудаас бүрдэнэ:
- Message - PSR-7 MessageInterface хэрэгжилт (headers, protocol, body)
- Request - PSR-7 RequestInterface
- Response - PSR-7 ResponseInterface
- ServerRequest - Глобал орчноос request сэргээдэг advanced implementation
- Uri - PSR-7 UriInterface
- Stream - PSR-7 StreamInterface хэрэгжилт
- UploadedFile - Upload хийгдсэн файлын metadata + moveTo()
- Output - StreamInterface хэрэгжилт (output buffering)
Дэлгэрэнгүй мэдээлэл
- Бүрэн танилцуулга - Суурилуулалт, хэрэглээ, жишээнүүд
- API тайлбар - Бүх метод, exception-үүдийн тайлбар
- Шалгалтын тайлан - Код шалгалтын тайлан
2. English description
Clean, minimal, object-oriented HTTP Message component (PSR-7). A lightweight component that implements HTTP message components following PHP's PSR-7 standard, including Request, Response, ServerRequest, URI, Stream, UploadedFile, OutputBuffer, and more.
codesaur/http-message is part of the codesaur ecosystem and is a lightweight PHP component that can be used standalone, independent of any framework.
The package consists of the following core classes:
- Message - PSR-7 MessageInterface implementation (headers, protocol, body)
- Request - PSR-7 RequestInterface
- Response - PSR-7 ResponseInterface
- ServerRequest - Advanced implementation that reconstructs request from global environment
- Uri - PSR-7 UriInterface
- Stream - PSR-7 StreamInterface implementation
- UploadedFile - Uploaded file metadata + moveTo()
- Output - StreamInterface implementation (output buffering)
Documentation
- Full Documentation - Installation, usage, examples
- API Reference - Complete API documentation
- Review - Code review report
3. Getting Started
Requirements
- PHP 8.2.1+
- ext-json PHP extension
- Composer
Installation
Composer ашиглан суулгана / Install via Composer:
composer require codesaur/http-message
Quick Example
use codesaur\Http\Message\ServerRequest; use codesaur\Http\Message\Response; // ServerRequest үүсгэх / Create ServerRequest $request = (new ServerRequest())->initFromGlobal(); // Query params var_dump($request->getQueryParams()); // PSR-7 headers унших / Read PSR-7 headers $contentType = $request->getHeaderLine('Content-Type'); $csrfToken = $request->getHeaderLine('X-CSRF-TOKEN'); // Response үүсгэх / Create Response $response = (new Response()) ->withStatus(200) ->withHeader('Content-Type', 'application/json'); // Body-д бичих / Write to body $response->getBody()->write(json_encode(['message' => 'Hello, World!']));
Running Tests
Тест ажиллуулах / Run tests:
# Бүх тестүүдийг ажиллуулах / Run all tests composer test # Coverage-тэй тест ажиллуулах / Run tests with coverage composer test-coverage
Changelog
- CHANGELOG.md - Full version history
Contributing & Security
License
This project is licensed under the MIT License.
Author
Narankhuu codesaur@gmail.com https://github.com/codesaur
codesaur ecosystem: https://codesaur.net
codesaur/http-message 适用场景与选型建议
codesaur/http-message 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.14k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「http」 「message」 「psr-7」 「http message」 「codesaur」 「mongol」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codesaur/http-message 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codesaur/http-message 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codesaur/http-message 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Model of a web-based resource
PHP AMQP Binding Library
Interfaces for web resource models and services to retrieve and create them
Interface for a factory to create Psr\Http\Message\StreamInterface objects
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 1.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 22
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-02