mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
增加app_dispatch钩子
This commit is contained in:
@@ -108,6 +108,9 @@ class App
|
||||
|
||||
// 获取应用调度信息
|
||||
$dispatch = self::$dispatch;
|
||||
// 监听 app_dispatch
|
||||
Hook::listen('app_dispatch', $dispatch);
|
||||
|
||||
// 未设置调度信息则进行 URL 路由检测
|
||||
if (empty($dispatch)) {
|
||||
$dispatch = self::routeCheck($request, $config);
|
||||
@@ -169,7 +172,9 @@ class App
|
||||
public static function initCommon()
|
||||
{
|
||||
if (empty(self::$init)) {
|
||||
if (defined('APP_NAMESPACE')) self::$namespace = APP_NAMESPACE;
|
||||
if (defined('APP_NAMESPACE')) {
|
||||
self::$namespace = APP_NAMESPACE;
|
||||
}
|
||||
|
||||
Loader::addNamespace(self::$namespace, APP_PATH);
|
||||
|
||||
@@ -184,11 +189,16 @@ class App
|
||||
ini_set('display_errors', 'Off');
|
||||
} elseif (!IS_CLI) {
|
||||
// 重新申请一块比较大的 buffer
|
||||
if (ob_get_level() > 0) $output = ob_get_clean();
|
||||
if (ob_get_level() > 0) {
|
||||
$output = ob_get_clean();
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
if (!empty($output)) echo $output;
|
||||
if (!empty($output)) {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!empty($config['root_namespace'])) {
|
||||
@@ -483,7 +493,9 @@ class App
|
||||
*/
|
||||
public static function module($result, $config, $convert = null)
|
||||
{
|
||||
if (is_string($result)) $result = explode('/', $result);
|
||||
if (is_string($result)) {
|
||||
$result = explode('/', $result);
|
||||
}
|
||||
|
||||
$request = Request::instance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user