scabbiafw / scabbia2-lightstack
This package is abandoned and no longer maintained.
The author suggests using the eserozvataf/scabbia2-lightstack package instead.
Scabbia2 LightStack Component
v0.1.2
2015-09-19 18:58 UTC
Requires
- php: >=5.6.0
Requires (Dev)
This package is not auto-updated.
Last update: 2022-02-01 12:38:03 UTC
README
This component is a simple abstraction layer which constructs Middleware
, Request
and Response
concepts will be shared with other components or codes. It's lighter alternative for smyfony's HttpKernel and HttpFoundation.
Usage
Request Object
use Scabbia\LightStack\Request; $request = Request::generateFromGlobals(); // full url in scheme://host:port/directory/ format echo $request->getEndpoint(); // http method echo $request->getFormat(); // path info echo $request->getPathInfo(); // remote ip echo $request->getRemoteIp(); // is ajax request? var_dump($request->isAsynchronous()); // instead of $_GET['p'] echo $request->get('p'); // or $_POST['p'] echo $request->post('p'); // or $_FILES['p'] var_dump($request->file('p')); // or $_GET['p'] || $_POST['p'] || $_FILES['p'] echo $request->data('p'); // or $_SERVER['REQUEST_METHOD']; echo $request->server('REQUEST_METHOD'); // or $_SESSION['p'] echo $request->session('p'); // or $_COOKIE['p'] echo $request->cookie('p'); // from http headers echo $request->header('Accept-Language'); // check if a value with key 'p' is posted var_dump($request->has('post', 'p')); // check if a file with key 'p' is uploaded var_dump($request->has('file', 'p')); // retrieve all posted values print_r($request->all('post')); // retrieve all values in request print_r($request->all());
Links
Contributing
It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome. All contributions should be filed on the eserozvataf/scabbia2-lightstack repository.