document_root
此功能较为简易, 请勿在公网环境直接使用
配置静态文件根目录,与enable_static_handler配合使用。
$server->set(['document_root' => '/data/webroot/example.com','enable_static_handler' => true,]);
设置document_root并设置enable_static_handler为true后,底层收到Http请求会先判断document_root路径下是否存在此文件,如果存在会直接发送文件内容给客户端,不再触发onRequest回调。
在
1.9.17或更高版本可用
使用静态文件处理特性时,应当将动态PHP代码和静态文件进行隔离,静态文件存放到特定的目录
