PHP Class Swoole, framework

Author: lanlin
Inheritance: extends CI_Controller
Show file 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 static property

public static $app_path

$charset static public property

static public $charset

$config public property

public $config

$controller_path public static property

public static $controller_path

$debug static public property

static public $debug

$default_controller static public property

static public $default_controller

$env public property

public $env

$error_call public property

public $error_call

$error_callback public property

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

$ext_http_server public property

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

$factory_key public property

传给factory
public $factory_key

$hooks protected property

protected $hooks

$load public property

public $load

$model public property

public ModelLoader,Swoole $model
return Swoole\ModelLoader

$modules static public property

可使用的组件
static public $modules

$multi_instance static public property

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

$objects protected property

对象池
protected array $objects
return array

$pagecache public property

public $pagecache

$php public static property

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

$protocol public property

public $protocol

$request public property

public Swoole\Request $request
return Swoole\Request

$response public property

public Swoole\Response $response
return Swoole\Response

$router_function protected property

protected $router_function

$server public property

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

$setting static public property

static public $setting