webman-framework
webman-framework copied to clipboard
webman-framework
v1.5.1 中将原来的 `createUnsafeImmutable` 改成了 `createUnsafeMutable`,这会导致逻辑变更: Immutable 会以系统环境中的 env 为主,.env 为辅 Mutable 会以.env 为主,系统环境中的 env 为辅 请问这改动是否符合改动预期 个人认为 Immutable 的形式应该更符合使用需求,因为一般在 docker 环境,会通过 env 覆盖 .env 的配置的 如果符合预期,这块目前有没有什么办法能做到动态改变 env 的使用模式 目前使用的折中办法:在 docker...
Add isGet and isPost
添加了对`405 Method Not Allowed`的支持; 使用和`Route::fallback`相似: ```php Route::methodNotAllowedFallback(function(){ // 允许的请求方式 var_dump(\Webman\App::$allowedMethods); return json(['code' => 405, 'msg' => '405 Method Not Allowed']); }); ``` **谢谢亮哥哥!😀**
## 原理 1. 使用workerman自带的Timer对长轮询请求进行处理 2. onMessage忽略来自LongPollingResponse的send处理 ## 描述 1. 增加了LongPollingResponse - LongPollingResponse接收request对象参数及wait参数 - wait参数用于控制长轮询等待时长 3. 修改了App.php onMessage、send部分 ## 使用 1. 控制器返回LongPollingResponse对象即可 ``` public function test(Request $request): Response { return (new...
```php class A implements MiddlewareInterface { public function process(Request $request, callable $next): Response { $response = $next($request); $err = $response->exception(); if ($err) { var_dump($err->getMessage()); return response('err'); } return $response; }...
```php Route::group('/admin', function () { Route::get('/aa', fn() => ''); Route::group('/bb', function () { Route::get('/cc', fn() => ''); }); })->middleware('abcMiddleware'); ``` 使用 `webman route:list` 显示结果 
```php Route::group('/a', function () { Route::resource('/x', app\admin\controller\AdminController::class); }); Route::group('/b', function () { Route::resource('/x', app\admin\controller\AdminController::class); }); ``` 该形式可以注册 `/a/x/index` 和 `/b/x/index` 的路由,但是它们的 name 都是 `x.index` 目前看路由的 name 注册和获取太过直接了当,貌似没有太好的解决办法
1.Fix:when visit the homepage found 404; 2.Add:customize the default home page config The following are some configurations. ``` app.php // the default app name, if single application please input ""...
`TypeError: Webman\App::__construct(): Argument #1 ($request_class) must be of type string, Workerman\Worker given, called in /webman/start.php on line 55 and defined in /webman/vendor/workerman/webman-framework/src/App.php:96` Also the new App construct have no container....