栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

App.php-1

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

App.php-1

// +----------------------------------------------------------------------

// | 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

// +----------------------------------------------------------------------

 

namespace think;// 放到同一个大包 下面

 

use thinkConfig;// 使用 配置类

use thinkEnv;// 使用环境类

use thinkException;// 使用异常包

use thinkexceptionHttpException;// 使用异常包 http包

use thinkexceptionHttpResponseException;// 使用异常包 http response 包

use thinkHook;// 使用 钩子 类

use thinkLang;// 使用 语言 类

use thinkLoader;// 使用 加载 类

use thinkLog;// 使用 日志 类

use thinkRequest;// 使用 请求 类

use thinkResponse;// 使用 返回 类

use thinkRoute;// 使用 路由 类

// 这个类应算是 皇上类了 可以调度基本上 全部的资源

class App

{

   

    protected static $init = false;// 初始化 标志位

 

   

    public static $modulePath;// 初始化 当前 模块 路径

 

   

    public static $debug = true;// 应用调试 模式

 

   

    public static $namespace = 'app';// 应用 类库 命名空间

 

   

    public static $suffix = false;// 应用 类库 后缀

 

   

    protected static $routeCheck;// 应用 路由 检测

 

   

    protected static $routeMust; // 严格 路由检测

 

    protected static $dispatch;// 路由调度

    protected static $file = []; // 文件加载

 

   

    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();// 加载 初始化 配置 文件 选项

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/229184.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号