nazg / http-executor
HTTP 组件和响应输出
0.12.1
2020-07-02 23:56 UTC
Requires
- hhvm: ^4.62
- facebook/hack-http-request-response-interfaces: ^0.3
- hhvm/hhvm-autoload: ^3.0
- hhvm/hsl: ^4.0
- hhvm/hsl-experimental: ^4.37
- nazg/http-server-request-handler: ^0.6
Requires (Dev)
- facebook/fbexpect: ^2.7
- hhvm/hacktest: ^2.0
- hhvm/hhast: ^4.0
- ytake/hungrr: ^0.13
README
此库提供以下工具:
- 输出 Hack HTTP 请求和响应接口 响应。
- 运行 Hack HTTP 服务器请求处理器 服务器请求处理器,涉及打包 Hack HTTP 请求和响应接口 ServerRequestInterface,处理请求创建引起的异常,并输出组合请求处理器返回的响应。
要求
HHVM 4.41.0 及以上版本。
安装
$ composer require nazg-hack/http-executor
用法
use type Ytake\Hungrr\ServerRequestFactory; use type Nazg\HttpExecutor\RequestHandleExecutor; use type Nazg\HttpExecutor\Emitter\SapiEmitter; use namespace HH\Lib\IO; <<__EntryPoint>> function main(): noreturn { list($readHandle, $writeHandle) = IO\pipe_nd(); $executor = new RequestHandleExecutor( $readHandle, $writeHandle, new ExampleRequestHandler(), new SapiEmitter(), ServerRequestFactory::fromGlobals() ); $executor->run(); }