[李景山php]每天TP5-20161211|App.php-1
来源:互联网 发布:手机注册淘宝账号申请 编辑:程序博客网 时间:2024/06/06 07:05
// +----------------------------------------------------------------------// | ThinkPHP [ WE CAN DO IT JUST THINK ]// +----------------------------------------------------------------------// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.// +----------------------------------------------------------------------// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )// +----------------------------------------------------------------------// | Author: liu21st <liu21st@gmail.com>// +----------------------------------------------------------------------namespace think;// 放到同一个大包 下面use think\Config;// 使用 配置类use think\Env;// 使用环境类use think\Exception;// 使用异常包use think\exception\HttpException;// 使用异常包 http包use think\exception\HttpResponseException;// 使用异常包 http response 包use think\Hook;// 使用 钩子 类use think\Lang;// 使用 语言 类use think\Loader;// 使用 加载 类use think\Log;// 使用 日志 类use think\Request;// 使用 请求 类use think\Response;// 使用 返回 类use think\Route;// 使用 路由 类// 这个类应算是 皇上类了 可以调度基本上 全部的资源/** * App 应用管理 * @author liu21st <liu21st@gmail.com> */class App{ /** * @var bool 是否初始化过 */ protected static $init = false;// 初始化 标志位 /** * @var string 当前模块路径 */ public static $modulePath;// 初始化 当前 模块 路径 /** * @var bool 应用调试模式 */ public static $debug = true;// 应用调试 模式 /** * @var string 应用类库命名空间 */ public static $namespace = 'app';// 应用 类库 命名空间 /** * @var bool 应用类库后缀 */ public static $suffix = false;// 应用 类库 后缀 /** * @var bool 应用路由检测 */ protected static $routeCheck;// 应用 路由 检测 /** * @var bool 严格路由检测 */ protected static $routeMust; // 严格 路由检测 protected static $dispatch;// 路由调度 protected static $file = []; // 文件加载 /** * 执行应用程序 * @access public * @param Request $request Request对象 * @return Response * @throws Exception */ public static function run(Request $request = null) {// thinkphp经过了 自动加载、错误接管、配置文件预设,终于开始执行了。 // 第一步:获取请求参数 is_null($request) && $request = Request::instance(); // self::$instance = new static($options); 执行了 这个 instance // 默认 没有传入任何数值,is_null 所以执行 后面 $request = Request::instance(); // 这个写法 真的 很经典,我喜欢你,老刘,哈哈 // 最终获取了 一个 request 对象 $config = self::initCommon();// 加载 初始化 配置 文件 选项
0 0
- [李景山php]每天TP5-20161211|App.php-1
- [李景山php]每天TP5-20161214|App.php
- [李景山php]每天TP5-20161212|App.php-2
- [李景山php]每天TP5-20161213|App.php-3
- [李景山php]每天TP5-20161203|Loader.php-1
- [李景山php]每天TP5-20161216|thinkphp5-helper.php-1
- [李景山php]每天TP5-20161224|thinkphp5-Console.php-1
- [李景山php]每天TP5-20170104|thinkphp5-File.php-1
- [李景山php]每天TP5-20170108|thinkphp5-Model.php-1
- [李景山php]每天TP5-20170116|thinkphp5-Url.php-1
- [李景山php]每天TP5-20170119|thinkphp5-Process.php-1
- [李景山php]每天TP5-20170128|thinkphp5-Validate.php-1
- [李景山php]每天TP5-20170129|thinkphp5-Request.php-1
- [李景山php]每天TP5-20170205|thinkphp5-Route.php-1
- [李景山php]每天TP5-20161202|base.php
- [李景山php]每天TP5-20161208|Loader.php
- [李景山php]每天TP5-20161209|Error.php
- [李景山php]每天TP5-20161210|Config.php
- 第七周项目4-队列数组
- mapreduce的reduce输出文件进行压缩
- SQL那些事儿(六)--数据库三大范式
- Maven的profile使用详解
- 全局搜索的两种方式
- [李景山php]每天TP5-20161211|App.php-1
- android studio快捷键
- Harris角点检测器
- css span原来是行内元素
- atoi 函数
- .Net调用Java的WebService之亲身体验 (转自梦幻Dot Net)
- 位运算的威力
- html5
- 欢迎使用CSDN-markdown编辑器