aura/web 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aura/web

最新稳定版本:2.2.1

Composer 安装命令:

composer require 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.

README 文档

README

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.

统计信息

  • 总下载量: 518.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 83
  • 点击次数: 2
  • 依赖项目数: 9
  • 推荐数: 0

GitHub 信息

  • Stars: 82
  • Watchers: 13
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2012-01-20