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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] * * * * * ## 1 配置文件——靜態結構 ### 1 全局變量 ~~~ 自定義 /public/index.php 框架默認 /thinkphp/base.php 模塊變量 /thinkphp/library/think/App.php ~~~ ### 2 模式配置 ~~~ 框架默認 /thinkphp/mode/common.php sae模式 /thinkphp/mode/sae.php 控制臺模式 /thinkphp/mode/console.php ~~~ ### 3 全局配置 ~~~ 框架默認 /thinkphp/convention.php ~~~ ### 4 應用配置 ~~~ 應用數據庫配置 /application/database.php 應用路由配置 /application/route.php ~~~ ### 5 模塊配置 ~~~ 應用默認配置 /application/config.php ~~~ ## 2 配置操作——動態組織 ### 1 配置加載 >[info] 全局變量 ~~~ /public/index.php: define('APP_PATH', __DIR__ . '/../test/'); define('APP_DEBUG', false); defined('APP_AUTO_BUILD',true); ~~~ ~~~ /thinkphp/start.php: require __DIR__ . '/base.php'; ~~~ ~~~ /thinkphp/library/think/App::module(): define('MODULE_NAME', strip_tags($module)); define('MODULE_PATH', APP_PATH . MODULE_NAME . DS); define('VIEW_PATH', MODULE_PATH . VIEW_LAYER . DS); define('CONTROLLER_NAME', Config::get('url_controller_convert') ? strtolower($controllerName) : $controllerName); define('ACTION_NAME', Config::get('url_action_convert') ? strtolower($actionName) : $actionName); ~~~ ~~~ /thinkphp/library/think/App::route(): define('__INFO__', $_SERVER['PATH_INFO']); define('__EXT__', strtolower(pathinfo($_SERVER['PATH_INFO'], PATHINFO_EXTENSION))); ~~~ >[info] 模式配置加載 ~~~ /thinkphp/start.php: $mode = require MODE_PATH . APP_MODE . EXT; ~~~ >[info] 全局配置加載 ~~~ /thinkphp/mode/common.php: 'config' => THINK_PATH . 'convention' . EXT, ~~~ >[info] 應用配置加載 ~~~ /thinkphp/convention.php: 'extra_config_list' => ['database', 'route', 'validate', 'auto'] ~~~ ~~~ /thinkphp/library/think/App.php::run(): if (!empty($config['extra_file_list'])) { foreach ($config['extra_file_list'] as $file) { $file = strpos($file, '.') ? $file : APP_PATH . $file . EXT; if (is_file($file)) { include_once $file; } } } ~~~ >[info] 模塊配置加載 ~~~ /thinkphp/library/think/App.php::initModule(): $config = Config::load(APP_PATH . $module . 'config' . EXT); if ($config['app_status']) { $config = Config::load(APP_PATH . $module . $config['app_status'] . EXT); } if ($config['extra_config_list']) { foreach ($config['extra_config_list'] as $name => $file) { $file = strpos($file, '.') ? $file : $path . $file . EXT; Config::load($file, is_string($name) ? $name : pathinfo($file, PATHINFO_FILENAME)); } } ~~~ ### 2 配置操作 >[info] 配置文件加載 `public static function load($file, $name = '', $range = '')` > $file 待解析配置文件 > $name ?? > $range 配置鍵名作用域 * * * * * >[info] 配置內容解析 `public static function parse($config, $type = '', $range = '')` > $config 待解析配置內容 > $type 配置解析器 > $range 配置鍵名作用域 * * * * * >[info] 配置參數讀寫 ~~~ public static function get($name = null, $range = '') public static function set($name, $value = null, $range = '') public static function has($name, $range = '') public static function reset($range = '') ~~~ > $name:配置鍵名 > $value:配置鍵值 > $range:配置鍵名作用域 * * * * * >[info] 框架主流程配置操作實例 ~~~ thinkphp/start.php: if (isset($mode['config'])) { is_array($mode['config']) ? Config::set($mode['config']) : Config::load($mode['config']); } ~~~ ~~~ thinkphp/library/think/App.php::run(): self::initModule(COMMON_MODULE, Config::get()); $config = Config::get(); ~~~ ~~~ thinkphp/library/think/App.php::intModule(): $config = Config::load(APP_PATH . $module . 'config' . EXT); $config = Config::load(APP_PATH . $module . $config['app_status'] . EXT); Config::load($file, is_string($name) ? $name : pathinfo($file, PATHINFO_FILENAME)); ~~~ >[info] 框架工具文件配置操作實例 ### 3 配置解析 >[info] 解析入口 ~~~ thinkphp/library/think/Config::parse(): public static function parse($config, $type = '', $range = '') { $range = $range ?: self::$range; if (empty($type)) { $type = pathinfo($config, PATHINFO_EXTENSION); } $class = (false === strpos($type, '\\')) ? '\\think\\config\\driver\\' . ucwords($type) : $type; self::set((new $class())->parse($config), '', $range); } ~~~ >[info] 解析器實現 `thinkphp/library/think/config/driver/Ini.php Ini配置內容解析` `thinkphp/library/think/config/driver/Xml.php Xml配置內容解析`
                  <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>

                              哎呀哎呀视频在线观看