mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 17:15:36 +08:00
reduce useless method
This commit is contained in:
@@ -89,12 +89,13 @@ class Framework
|
|||||||
*/
|
*/
|
||||||
public function init(): Framework
|
public function init(): Framework
|
||||||
{
|
{
|
||||||
|
// 顺序执行引导器
|
||||||
foreach ($this->bootstrappers as $bootstrapper) {
|
foreach ($this->bootstrappers as $bootstrapper) {
|
||||||
app($bootstrapper)->bootstrap($this->argv);
|
app($bootstrapper)->bootstrap($this->argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行一些 Driver 前置条件的内容
|
// 初始化 @OnSetup 事件
|
||||||
$this->initDriverPrerequisites();
|
$this->initSetupAnnotations();
|
||||||
|
|
||||||
// 初始化 Driver 及框架内部需要监听的事件
|
// 初始化 Driver 及框架内部需要监听的事件
|
||||||
$this->initDriver();
|
$this->initDriver();
|
||||||
@@ -178,24 +179,6 @@ class Framework
|
|||||||
return $this->driver;
|
return $this->driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 在框架的 Driver 层初始化前的一些前提条件
|
|
||||||
*
|
|
||||||
* 1. 设置 config 读取的目录
|
|
||||||
* 2. 初始化框架运行时的常量
|
|
||||||
* 3. 初始化 Logger
|
|
||||||
* 4. 初始化 EventProvider
|
|
||||||
* 5. 设置时区,防止 Logger 时间乱跳
|
|
||||||
* 6. 覆盖 PHP 报错样式解析
|
|
||||||
* 7. 解析命令行参数
|
|
||||||
* 8. 读取、解析并执行 OnSetup 注解
|
|
||||||
*/
|
|
||||||
public function initDriverPrerequisites()
|
|
||||||
{
|
|
||||||
// 初始化 @OnSetup 事件
|
|
||||||
$this->initSetupAnnotations();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化驱动及相关事件
|
* 初始化驱动及相关事件
|
||||||
* 实例化 Driver 对象
|
* 实例化 Driver 对象
|
||||||
|
|||||||
Reference in New Issue
Block a user