Свойство | Тип | Описание | |
---|---|---|---|
$app_path | |||
$charset | |||
$config | |||
$controller_path | |||
$debug | |||
$default_controller | |||
$env | |||
$error_call | |||
$error_callback | 发生错误时的回调函数 | ||
$ext_http_server | Swoole\Http\ExtServer | ||
$factory_key | 传给factory | ||
$load | |||
$model | Swoole\ModelLoader | ||
$modules | 可使用的组件 | ||
$multi_instance | array | 允许多实例的模块 | |
$pagecache | |||
$php | Swoole | Swoole类的实例 | |
$protocol | |||
$request | Swoole\Request | ||
$response | Swoole\Response | ||
$server | Swoole\Protocol\HttpServer | ||
$setting |
Свойство | Тип | Описание | |
---|---|---|---|
$hooks | |||
$objects | array | 对象池 | |
$router_function |
Метод | Описание | |
---|---|---|
__call ( $func, $param ) | ||
__clean ( ) | 清理 | |
__get ( $lib_name ) | ||
__init ( ) : null | 初始化环境 | |
addHook ( $type, $func ) | 增加钩子函数 | |
afterAction ( callable $callback ) | 在Action执行后回调 | |
afterRequest ( callable $callback ) | 在请求之后执行一个函数 | |
beforeAction ( callable $callback ) | 在Action执行前回调 | |
beforeRequest ( callable $callback ) | 在请求之前执行一个函数 | |
clearHook ( $type ) | 清理钩子程序 | |
getInstance ( ) : Swoole | 初始化 | |
gzip ( ) : null | 压缩内容 | |
handlerServer ( Swoole\Request $request ) | ||
reloadController ( $mvc, $controller_file ) | ||
router ( $function ) | 设置路由器 | |
runHttpServer ( $host = '0.0.0.0', $port = 9501, $config = [] ) | ||
runMVC ( ) | 运行MVC处理模型 | |
runtime ( ) : array | 获取资源消耗 | |
setAppPath ( $dir ) | 设置应用程序路径 | |
setControllerPath ( $dir ) | 设置应用程序路径 | |
urlRoute ( ) |
Метод | Описание | |
---|---|---|
callHook ( $type ) | 执行Hook函数列表 | |
loadModule ( $module, $key = 'master' ) : mixed | 加载内置的Swoole模块 |
Метод | Описание | |
---|---|---|
__construct ( ) |
public afterAction ( callable $callback ) | ||
$callback | callable |
public afterRequest ( callable $callback ) | ||
$callback | callable |
public beforeAction ( callable $callback ) | ||
$callback | callable |
public beforeRequest ( callable $callback ) | ||
$callback | callable |
static public getInstance ( ) : Swoole | ||
Результат | Swoole |
public handlerServer ( Swoole\Request $request ) | ||
$request | Swoole\Request |
protected loadModule ( $module, $key = 'master' ) : mixed | ||
$module | ||
$key | ||
Результат | mixed |
public runHttpServer ( $host = '0.0.0.0', $port = 9501, $config = [] ) |
static public setControllerPath ( $dir ) | ||
$dir |
public Swoole\Http\ExtServer $ext_http_server | ||
Результат | Swoole\Http\ExtServer |
static public array $multi_instance | ||
Результат | array |
public Swoole\Protocol\HttpServer $server | ||
Результат | Swoole\Protocol\HttpServer |