[李景山php]每天TP5-20161211|App.php-1

來源:互聯網
上載者:User

標籤:thinkphp5

// +----------------------------------------------------------------------// | 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 <[email protected]>// +----------------------------------------------------------------------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 <[email protected]> */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();// 載入 初始化 配置 檔案 選項


本文出自 “專註php 群號:414194301” 部落格,請務必保留此出處http://jingshanls.blog.51cto.com/3357095/1859690

[李景山php]每天TP5-20161211|App.php-1

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.