修正App类

This commit is contained in:
thinkphp
2016-05-17 13:15:28 +08:00
parent 9d5728c67f
commit 2b184efc47

View File

@@ -100,9 +100,6 @@ class App
// 规则闭包 // 规则闭包
$data = self::invokeFunction($dispatch['function'], $dispatch['params']); $data = self::invokeFunction($dispatch['function'], $dispatch['params']);
break; break;
case 'finish':
// 已经完成 不再继续执行
break;
default: default:
throw new Exception('dispatch type not support', 10008); throw new Exception('dispatch type not support', 10008);
} }
@@ -111,16 +108,16 @@ class App
} }
// 监听app_end // 监听app_end
APP_HOOK && Hook::listen('app_end', isset($data) ? $data : ''); APP_HOOK && Hook::listen('app_end', $data);
if (isset($data)) {
// 输出数据到客户端 // 输出数据到客户端
if ($data instanceof Response) { if ($data instanceof Response) {
return $data->send(); return $data->send();
} else { } elseif (!is_null($data)) {
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type'); $type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
return Response::create($data, $type)->send(); return Response::create($data, $type)->send();
} }
}
} }
// 执行函数或者闭包方法 支持参数调用 // 执行函数或者闭包方法 支持参数调用