Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 3.12.151.104
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
boaz /
vendor /
nyholm /
psr7 /
[ HOME SHELL ]
Name
Size
Permission
Action
doc
[ DIR ]
drwxrwxr-x
src
[ DIR ]
drwxrwxr-x
CHANGELOG.md
2.58
KB
-rw-rw-r--
LICENSE
1.04
KB
-rw-rw-r--
README.md
3.71
KB
-rw-rw-r--
composer.json
1.19
KB
-rw-rw-r--
psalm.xml
444
B
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : README.md
# PSR-7 implementation [](https://github.com/Nyholm/psr7/releases) [](https://travis-ci.org/Nyholm/psr7) [](https://scrutinizer-ci.com/g/Nyholm/psr7) [](https://scrutinizer-ci.com/g/Nyholm/psr7) [](https://packagist.org/packages/nyholm/psr7) [](https://packagist.org/packages/nyholm/psr7) [](LICENSE) A super lightweight PSR-7 implementation. Very strict and very fast. | Description | Guzzle | Laminas | Slim | Nyholm | | ---- | ------ | ---- | ---- | ------ | | Lines of code | 3 000 | 3 000 | 1 700 | 1 000 | | PSR-7* | 66% | 100% | 75% | 100% | | PSR-17 | No | Yes | Yes | Yes | | HTTPlug | No | No | No | Yes | | Performance** | 1.34x | 1x | 1.16x | 1.75x | \* Percent of completed tests in https://github.com/php-http/psr7-integration-tests \** See benchmark at https://github.com/Nyholm/http-client-benchmark (higher is better) ## Installation ```bash composer require nyholm/psr7 ``` If you are using Symfony Flex then you get all message factories registered as services. ## Usage The PSR-7 objects do not contain any other public methods than those defined in the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). ### Create objects Use the PSR-17 factory to create requests, streams, URIs etc. ```php $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); $stream = $psr17Factory->createStream('foobar'); ``` ### Sending a request With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send requests like: ```bash composer require kriswallsmith/buzz ``` ```php $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $psr18Client = new \Buzz\Client\Curl($psr17Factory); $request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); $response = $psr18Client->sendRequest($request); ``` ### Create server requests The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used to create server requests from PHP superglobals. ```bash composer require nyholm/psr7-server ``` ```php $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $creator = new \Nyholm\Psr7Server\ServerRequestCreator( $psr17Factory, // ServerRequestFactory $psr17Factory, // UriFactory $psr17Factory, // UploadedFileFactory $psr17Factory // StreamFactory ); $serverRequest = $creator->fromGlobals(); ``` ### Emitting a response ```bash composer require laminas/laminas-httphandlerrunner ``` ```php $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $responseBody = $psr17Factory->createStream('Hello world'); $response = $psr17Factory->createResponse(200)->withBody($responseBody); (new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); ``` ## Our goal This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and [Martijn van der Ven](https://vanderven.se/martijn/). They have decided that the goal of this library should be to provide a super strict implementation of [PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. The package will never include any extra features nor helper methods. All our classes and functions exist because they are required to fulfill the PSR-7 specification.
Close