cjrasmussen / request
Helper class for working with information about web requests
2.1.5
2024-07-08 19:04 UTC
Requires
- php: >=7.4.0
Requires (Dev)
- phpunit/phpunit: ^9.6
- roave/security-advisories: dev-latest
README
Helper class for working with information about web requests. Useful for accessing request data in an object-oriented fashion.
Usage
use cjrasmussen\Request\RequestData; $requestData = new RequestData($_GET, $_POST, $_COOKIES, $_FILES, $_SERVER, $_ENV); $isWebRequest = $requestData->isWebRequest(); if ($isWebRequest) { $url = $requestData->getRequestedUrl(); } // access $_GET['id'] $requestData->query->get('id');
Installation
Simply add a dependency on cjrasmussen/request to your composer.json file if you use Composer to manage the dependencies of your project:
composer require cjrasmussen/request
Although it's recommended to use Composer, you can actually include the file(s) any way you want.
License
Request is MIT licensed.