Git Product home page Git Product logo

aura.web's Introduction

Aura.Web

Provides web Request and Response objects for use by web controllers and actions. These are representations of the PHP web environment, not HTTP request and response objects proper.

Foreword

Installation

This library requires PHP 5.3 or later; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.

It is installable and autoloadable via Composer as aura/web.

Alternatively, download a release or clone this repository, then require or include its autoload.php file.

Quality

Scrutinizer Code Quality codecov Continuous Integration

To run the unit tests at the command line, issue composer install and then ./vendor/bin/phpunit at the package root. This requires Composer to be available as composer.

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Community

To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our Google Group, follow @auraphp on Twitter, or chat with us on #auraphp on Freenode.

Getting Started

Instantiation

First, instantiate a WebFactory object, then use it to create Request and Response objects.

<?php
use Aura\Web\WebFactory;

$web_factory = new WebFactory($GLOBALS);
$request = $web_factory->newRequest();
$response = $web_factory->newResponse();
?>

Note that if jit-globals is turned on, merely passing $GLOBALS will not work properly. In this case, use compact() to pass the needed values. For example:

<?php
use Aura\Web\WebFactory;

$web_factory = new WebFactory(array(
    '_ENV' => $_ENV,
    '_GET' => $_GET,
    '_POST' => $_POST,
    '_COOKIE' => $_COOKIE,
    '_SERVER' => $_SERVER
));
$request = $web_factory->newRequest();
$response = $web_factory->newResponse();
?>

Request and Response Objects

Because each object contains so much functionality, we have split up the documentation into a Request page and a Response page.

By way of overview, the Request object has these sub-objects ...

... and the Response object has these sub-objects:

Once you have built a Response you can send it with any HTTP mechanism you prefer, including plain PHP.

Be sure to read the Request and Response pages for more detailed information.

aura.web's People

Contributors

darthyody avatar dhrrgn avatar dshafik avatar galactic-void avatar garoevans avatar harikt avatar iansltx avatar jakeasmith avatar jelofson avatar pborreli avatar pmjones avatar proggeler avatar ralouphie avatar timetoogo avatar zkwbbr avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.