digphp / psr17
digphp psr17
1.0.0
2022-03-10 05:51 UTC
Requires
- guzzlehttp/psr7: ^1.6
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2025-03-10 11:59:07 UTC
README
php psr17
Installation
composer require digphp/psr17
Usage
$factory = new \DigPHP\Psr17\Factory; $request = $factory->createRequest(string $method, $uri); $response = $factory->createResponse(int $code = 200, string $reasonPhrase = ''); $response = $factory->createGeneralResponse(int $code = 200, array $headers = [], string $body = null); $server_request = $factory->createServerRequest(string $method, $uri, array $serverParams = []); $stream = $factory->createStream(string $content = ''); $stream = $factory->createStreamFromFile(string $file, string $mode = 'r'); $stream = $factory->createStreamFromResource($resource); $upload_file = $factory->createUploadedFile(StreamInterface $stream,int $size = null,int $error = \UPLOAD_ERR_OK,string $clientFilename = null,string $clientMediaType = null); $uri = $factory->createUri(string $uri = '');