PHP Class Swoole, framework

Author: lanlin
Inheritance: extends CI_Controller
ファイルを表示 Open project: matyhtf/swoole_framework Class Usage Examples

Public Properties

Property Type Description
$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

Protected Properties

Property Type Description
$hooks
$objects array 对象池
$router_function

Public Methods

Method Description
__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 ( )

Protected Methods

Method Description
callHook ( $type ) 执行Hook函数列表
loadModule ( $module, $key = 'master' ) : mixed 加载内置的Swoole模块

Private Methods

Method Description
__construct ( )

Method Details

__call() public method

public __call ( $func, $param )

__clean() public method

清理
public __clean ( )

__get() public method

public __get ( $lib_name )

__init() public method

初始化环境
public __init ( ) : null
return null

addHook() public method

增加钩子函数
public addHook ( $type, $func )
$type
$func

afterAction() public method

在Action执行后回调
public afterAction ( callable $callback )
$callback callable

afterRequest() public method

在请求之后执行一个函数
public afterRequest ( callable $callback )
$callback callable

beforeAction() public method

在Action执行前回调
public beforeAction ( callable $callback )
$callback callable

beforeRequest() public method

在请求之前执行一个函数
public beforeRequest ( callable $callback )
$callback callable

callHook() protected method

执行Hook函数列表
protected callHook ( $type )
$type

clearHook() public method

清理钩子程序
public clearHook ( $type )
$type

getInstance() static public method

初始化
static public getInstance ( ) : Swoole
return Swoole

gzip() public method

压缩内容
public gzip ( ) : null
return null

handlerServer() public method

public handlerServer ( Swoole\Request $request )
$request Swoole\Request

loadModule() protected method

加载内置的Swoole模块
protected loadModule ( $module, $key = 'master' ) : mixed
$module
$key
return mixed

reloadController() public method

public reloadController ( $mvc, $controller_file )

router() public method

设置路由器
public router ( $function )
$function

runHttpServer() public method

public runHttpServer ( $host = '0.0.0.0', $port = 9501, $config = [] )

runMVC() public method

运行MVC处理模型
public runMVC ( )

runtime() public method

获取资源消耗
public runtime ( ) : array
return array

setAppPath() static public method

设置应用程序路径
static public setAppPath ( $dir )
$dir

setControllerPath() static public method

设置应用程序路径
static public setControllerPath ( $dir )
$dir

urlRoute() public method

public urlRoute ( )

Property Details

$app_path public_oe static_oe property

public static $app_path

$charset static_oe public_oe property

static public $charset

$config public_oe property

public $config

$controller_path public_oe static_oe property

public static $controller_path

$debug static_oe public_oe property

static public $debug

$default_controller static_oe public_oe property

static public $default_controller

$env public_oe property

public $env

$error_call public_oe property

public $error_call

$error_callback public_oe property

发生错误时的回调函数
public $error_callback

$ext_http_server public_oe property

public Swoole\Http\ExtServer $ext_http_server
return Swoole\Http\ExtServer

$factory_key public_oe property

传给factory
public $factory_key

$hooks protected_oe property

protected $hooks

$load public_oe property

public $load

$model public_oe property

public ModelLoader,Swoole $model
return Swoole\ModelLoader

$modules static_oe public_oe property

可使用的组件
static public $modules

$multi_instance static_oe public_oe property

允许多实例的模块
static public array $multi_instance
return array

$objects protected_oe property

对象池
protected array $objects
return array

$pagecache public_oe property

public $pagecache

$php public_oe static_oe property

Swoole类的实例
public static Swoole $php
return Swoole

$protocol public_oe property

public $protocol

$request public_oe property

public Swoole\Request $request
return Swoole\Request

$response public_oe property

public Swoole\Response $response
return Swoole\Response

$router_function protected_oe property

protected $router_function

$server public_oe property

public Swoole\Protocol\HttpServer $server
return Swoole\Protocol\HttpServer

$setting static_oe public_oe property

static public $setting