easyswoole / http-annotation
php stander lib
Installs: 85 812
Dependents: 14
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 11
Open Issues: 10
Requires
- php: >=8.1
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-mbstring: *
- ext-simplexml: *
- easyswoole/http: 3.x
- easyswoole/parsedown: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- easyswoole/phpunit: ^1.0
- easyswoole/swoole-ide-helper: ^1.0
- 3.x-dev
- 3.2.22
- 3.2.21
- 3.2.20
- 3.2.19
- 3.2.18
- 3.2.17
- 3.2.16
- 3.2.15
- 3.2.14
- 3.2.13
- 3.2.12
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.3
- 3.2.2
- 3.2.1
- 3.1.10
- 3.1.9
- 3.1.8
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.9
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 2.x-dev
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.5.0
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.1
- 1.0.0
- dev-master
This package is auto-updated.
Last update: 2024-12-01 00:12:05 UTC
README
安装
composer require easyswoole/http-annotation
注解规范
Example
use EasySwoole\Http\AbstractInterface\AbstractRouter; use EasySwoole\Http\Dispatcher; use EasySwoole\Http\Request; use EasySwoole\Http\Response; use EasySwoole\HttpAnnotation\Utility; use Swoole\Http\Server; $nameSpace = 'EasySwoole\HttpAnnotation\Tests\ControllerExample'; $dispatcher = new Dispatcher(); $dispatcher->setNamespacePrefix($nameSpace); $dispatcher->enableFakeRouter(); $dispatcher->setOnRouterCreate(function (AbstractRouter $router)use($nameSpace){ Utility::mappingRouter($router->getRouteCollector(),"tests/ControllerExample",$nameSpace); }); $http = new Server("127.0.0.1", 9501); $http->set([ "worker_num"=>1 ]); $http->on("request", function ($request, $response) use($dispatcher){ $request_psr = new Request($request); $response_psr = new Response($response); $dispatcher->dispatch($request_psr, $response_psr); $response_psr->__response(); }); $http->start();