承接 adinan-cenci/psr-17 相关项目开发

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

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

adinan-cenci/psr-17

最新稳定版本:v2.1.1

Composer 安装命令:

composer require adinan-cenci/psr-17

包简介

An implementation of the PSR-17 specification.

README 文档

README

This is an implementation of the PSR-17 specification.

Besides the psr methods, the factories also include some useful ones:

ResponseFactory

use AdinanCenci\Psr17\ResponseFactory;

$responseFactory = new ResponseFactory();

// Returns an instance of Psr\Http\Message\ResponseInterface with
// code 200
$factory->ok('your body here');

// 201
$factory->created('your body here');

// 301
$factory->movedPermanently('http://redirect.to');

// 302
$factory->movedTemporarily('http://redirect.to');

// 400
$factory->badRequest('your body here');

// 401
$factory->unauthorized('your body here');

// 403
$factory->forbidden('your body here');

// 404
$factory->notFound('your body here');

// 500
$factory->internalServerError('your body here');

// 501
$factory->notImplemented('your body here');

// 502
$factory->badGateway('your body here');

// 503
$factory->serviceUnavailable('your body here');

ServerRequestFactory

use AdinanCenci\Psr17\ServerRequestFactory;

$requestFactory = new ServerRequestFactory();

// Creates an instance of Psr\Http\Message\ServerRequestInterface
// out of the global values.
$request = $requestFactory->createFromGlobals();

UploadedFileFactory

use AdinanCenci\Psr17\UploadedFileFactory;

$filesFactory = new UploadedFileFactory();

// Will return the contents of $_FILES as 
// Psr\Http\Message\UploadedFileInterface instances.
$files = $filesFactory->getFilesFromGlobals();




Licence

Mit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-08