首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
swoole_http_server sendfile
希望swoole_http_server底层支持特定mimetype类型文件的处理,原生支持sendfile, 使用应用层,PHP去处理静态文件,性能不好
发布于9年前 · 1 次浏览 · 来自
提问
、
、
希望swoole_http_server底层支持特定mimetype类型文件的处理,原生支持sendfile, 使用应用层,PHP去处理静态文件,性能不好
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2017-07-01
淡
淡定(贾立国)
最新版本的Swoole已经支持了http_server的sendfile,但是`MIME`需要用户代码自己指定。
赞
0
回复
2017-07-12
L
Larrypew
http://wiki.swoole.com/wiki/page/187.html 这个教程只涉及到swoole_server的中用法,对于swoole_http_server的onRequest回调中并没有$fd,如何使用sendfile呢? swoole_http_response->sendfile ?
赞
0
回复
2017-07-12
A
AMor
看了下swoole_http_server的源码,找到一行 static PHP_METHOD(swoole_http_response, sendfile); 应该是$response->sendfile($file);
赞
0
回复
2017-07-12
常
常帮主
protected function doStatic(\swoole_http_request $request, \swoole_http_response $response) { $file = $_SERVER['REQUEST_URI']; if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $file = subst
赞
0
回复
2017-07-13
冰
冰河-J
PHP7环境下的BUG,已修复。
赞
0
回复