定制 codesaur/http-message 二次开发

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

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

codesaur/http-message

Composer 安装命令:

composer require codesaur/http-message

包简介

Цэвэр, минимал, объект хандалтат бүтэцтэй HTTP Message компонент (PSR-7)

README 文档

README

CI PHP Version License

Агуулга / Table of Contents

  1. Монгол | 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)

Дэлгэрэнгүй мэдээлэл

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

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

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 codesaur/http-message 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-02