承接 philharmony/http-psr-extension 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

philharmony/http-psr-extension

最新稳定版本:v1.0.0

Composer 安装命令:

composer require philharmony/http-psr-extension

包简介

Optional extensions for PSR-7 and PSR-17 HTTP interfaces

README 文档

README

PHP Version PSR Latest Stable Version Total Downloads License

Optional extensions for PSR-7 and PSR-17 HTTP interfaces

📦 Installation

composer require philharmony/http-psr-extension

🧠 Overview

This package provides optional extension interfaces for PSR-7 and PSR-17.

It does not replace PSR standards, but adds additional capabilities that can be detected at runtime.

⚙️ Philosophy

  • PSR interfaces remain the baseline
  • Extensions are optional
  • Use instanceof for capability detection
  • Always provide a fallback to standard PSR behavior

🚀 Usage

Detect extended UploadedFileFactory

use Philharmony\Http\PsrExtension\UploadedFileFactoryFromFileInterface;

if ($factory instanceof UploadedFileFactoryFromFileInterface) {
$file = $factory->createUploadedFileFromFile(
    file: '/tmp/file.txt',
    size: 1024,
    errorStatus: UPLOAD_ERR_OK,
    clientFilename: 'avatar.png',
    clientMediaType: 'image/png',
    fullPath: 'users/avatars/avatar.png' // PHP 8.1+ support   
);
} else {
// fallback to PSR-17
}

Detect full path support

use Philharmony\Http\PsrExtension\UploadedFileFullPathInterface;

if ($uploadedFile instanceof UploadedFileFullPathInterface) {
    $fullPath = $uploadedFile->getFullPath();
} else {
// fallback to PSR-17  
}

🔌 Compatibility

  • Works with any PSR-7 implementation
  • Works with any PSR-17 factory
  • No runtime dependencies

📄 License

This package is open-source and licensed under the MIT License. See the LICENSE file for details.

🤝 Contributing

Contributions, issues, and feature requests are welcome.

If you find a bug or have an idea for improvement, please open an issue or submit a pull request.

⭐ Support

If you find this package useful, please consider giving it a star on GitHub. It helps the project grow and reach more developers.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固