Download the PHP package upscale/swoole-reflection without Composer
On this page you can find all versions of the php package upscale/swoole-reflection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download upscale/swoole-reflection
More information about upscale/swoole-reflection
Files in upscale/swoole-reflection
Package swoole-reflection
Short Description Reflection API for Swoole web-server
License Apache-2.0
Homepage https://github.com/upscalesoftware/swoole-reflection
Informations about the package swoole-reflection
Swoole Reflection API
This library provides a Reflection API for classes of Swoole / Open Swoole web-server.
Features:
- Server middleware manipulation
- Response lifecycle tracking
Installation
The library is to be installed via Composer as a dependency:
Usage
Middleware Manipulation
Override server middleware optionally reusing the original callback:
Response Lifecycle
Headers Tracking
Modify response headers before they have been sent:
Callback is invoked on every request upon the first call to \Swoole\Http\Response::write/end/sendfile()
.
Warning! Callbacks that need to modify response must use the original response rather than its observable proxy.
Dependency on observable proxy creates circular reference between the proxy and callbacks registered within it.
Instances involved in orphan circular cross-references will not be destroyed until the next garbage collection cycle.
Swoole calls \Swoole\Http\Response::end()
in the response destructor executed upon the request completion.
The response destructor will not be called causing the the worker to hang up without sending the response.
Body Interception
Modify response body before sending it out:
Callback is invoked on every call to \Swoole\Http\Response::write/end()
with non-empty contents.
Contributing
Pull Requests with fixes and improvements are welcome!
License
Copyright © Upscale Software. All rights reserved.
Licensed under the Apache License, Version 2.0.
All versions of swoole-reflection with dependencies
upscale/ext-swoole Version ^5.0
upscale/ext-openswoole Version ^4.8||^22.0