Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
Framework类 参考
Framework 的协作图:
[图例]

Public 成员函数

 __construct ()
 
 init (array $argv=[])
 
 start ()
 
 stop (int $retcode=0)
 
 reload ()
 
 getArgv ()
 
 getDriver ()
 
 initDriver ()
 
 initFramework ()
 
 bootstrap (?string $bootstrapper=null)
 

成员变量

const VERSION_ID = 723
 
const VERSION = '3.2.4'
 
RuntimePreferences $runtime_preferences
 

Protected 属性

array $argv
 
SwooleDriver Driver WorkermanDriver null $driver = null
 
array $setup_annotations = []
 
array $bootstrappers
 

详细描述

框架入口类

自从
3.0

@method static Framework getInstance()

构造及析构函数说明

◆ __construct()

__construct ( )

框架初始化文件

异常

Exception

成员函数说明

◆ bootstrap()

bootstrap ( ?string  $bootstrapper = null)

执行初始化的函数列表

参数
null | string$bootstrapper要运行的 bootstrapper

◆ getArgv()

getArgv ( )

获取传入的参数

◆ getDriver()

getDriver ( )

获取驱动

◆ init()

init ( array  $argv = [])

初始化框架

参数
array<string,null|bool|string>$argv 传入的参数(见 ServerStartCommand)
异常

Exception

◆ initDriver()

initDriver ( )

初始化驱动及相关事件 实例化 Driver 对象

异常

Exception

函数调用图:

◆ initFramework()

initFramework ( )

初始化框架并输出一些信息

绑定、注册框架本身的事件到 Driver 的 EventProvider 中

◆ reload()

reload ( )

重载框架的 worker 进程,重新加载模块及代码

此方法仅限于 Unix 环境下的多进程模式(即存在 Worker 进程的模式)使用,Windows 环境、单进程模式使用无效

未测试,需要对单进程等特殊情况做判断,因为单进程等模式无法重启

◆ start()

start ( )

启动框架

◆ stop()

stop ( int  $retcode = 0)

停止框架运行

未测试

参数
int$retcode退出码
异常
ZMKnownException

结构体成员变量说明

◆ $argv

array $argv
protected

◆ $bootstrappers

array $bootstrappers
protected
初始值:
= [
Bootstrap\LoadConfiguration::class,
Bootstrap\LoadGlobalDefines::class,
Bootstrap\RegisterLogger::class,
Bootstrap\HandleExceptions::class,
Bootstrap\RegisterEventProvider::class,
Bootstrap\SetInternalTimezone::class,
]

◆ $driver

SwooleDriver Driver WorkermanDriver null $driver = null
protected

◆ $runtime_preferences

RuntimePreferences $runtime_preferences

◆ $setup_annotations

array $setup_annotations = []
protected

◆ VERSION

const VERSION = '3.2.4'

◆ VERSION_ID

const VERSION_ID = 723

该类的文档由以下文件生成: