<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] * * * * * ## 1 模式配置文件源代碼(以/thinkphp/mode/common.php為例,console.php,sae.php模式同理) ~~~ return [ // 命名空間 'namespace' => [ 'think' => LIB_PATH . 'think' . DS, 'behavior' => LIB_PATH . 'behavior' . DS, 'traits' => LIB_PATH . 'traits' . DS, APP_NAMESPACE => APP_PATH, ], // 配置文件 'config' => THINK_PATH . 'convention' . EXT, // 別名定義 'alias' => [ 'think\App' => CORE_PATH . 'App' . EXT, 'think\Build' => CORE_PATH . 'Build' . EXT, 'think\Cache' => CORE_PATH . 'Cache' . EXT, 'think\Config' => CORE_PATH . 'Config' . EXT, 'think\Controller' => CORE_PATH . 'Controller' . EXT, 'think\Cookie' => CORE_PATH . 'Cookie' . EXT, 'think\Db' => CORE_PATH . 'Db' . EXT, 'think\Debug' => CORE_PATH . 'Debug' . EXT, 'think\Error' => CORE_PATH . 'Error' . EXT, 'think\Exception' => CORE_PATH . 'Exception' . EXT, 'think\Hook' => CORE_PATH . 'Hook' . EXT, 'think\Input' => CORE_PATH . 'Input' . EXT, 'think\Lang' => CORE_PATH . 'Lang' . EXT, 'think\Log' => CORE_PATH . 'Log' . EXT, 'think\Model' => CORE_PATH . 'Model' . EXT, 'think\Response' => CORE_PATH . 'Response' . EXT, 'think\Route' => CORE_PATH . 'Route' . EXT, 'think\Session' => CORE_PATH . 'Session' . EXT, 'think\Template' => CORE_PATH . 'Template' . EXT, 'think\Url' => CORE_PATH . 'Url' . EXT, 'think\View' => CORE_PATH . 'View' . EXT, 'think\db\Driver' => CORE_PATH . 'db' . DS . 'Driver' . EXT, 'think\view\driver\Think' => CORE_PATH . 'view' . DS . 'driver' . DS . 'Think' . EXT, 'think\template\driver\File' => CORE_PATH . 'template' . DS . 'driver' . DS . 'File' . EXT, 'think\log\driver\File' => CORE_PATH . 'log' . DS . 'driver' . DS . 'File' . EXT, 'think\cache\driver\File' => CORE_PATH . 'cache' . DS . 'driver' . DS . 'File' . EXT, ], ]; ~~~ ## 2 分析 模式配置文件用來配置框架的運行環境。 common.php 通用運行環境, sae.php 新浪云運行環境, console.php 命令行運行環境 `defined('APP_MODE') or define('APP_MODE', function_exists('saeAutoLoader') ? 'sae' : 'common');` 運行模式由全局變量文件/thinkphp/base.php中的APP_MODE定義 `$mode = require MODE_PATH . APP_MODE . EXT;` 在thinkphp/start.php中加載對應模式文件,并初始化運行環境。 ~~~ if (isset($mode['namespace'])) { Loader::addNamespace($mode['namespace']); } ~~~ namespace 為模式對應環境的根命名空間數組。 ~~~ if (isset($mode['alias'])) { Loader::addMap(is_array($mode['alias']) ? $mode['alias'] : include $mode['alias']); } ~~~ alias 為模式對應環境的類別名數組。 ~~~ if (isset($mode['config'])) { is_array($mode['config']) ? Config::set($mode['config']) : Config::load($mode['config']); } ~~~ config 為模式對應環境的配置數組 common模式加載thinkphp/convention.php作為默認全局配置 ~~~ if (APP_HOOK && isset($mode['tags'])) { Hook::import(is_array($mode['tags']) ? $mode['tags'] : include $mode['tags']); } ~~~ tags為模式對應環境的監聽回調數組 ## 3 總結 模式配置文件通常用來配置框架運行環境信息,分為四部分。 namespace 根命名空間數組 alias 類的別名數組 config 框架的全局配置文件 tags 運行的監聽回調數組 模式配置文件的使用 見 使用范例的運行模式開發
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看