thinkphp5 預設配置代碼

來源:互聯網
上載者:User

標籤:isp   排除   control   _id   erro   highlight   dir   rect   pac   

<?php// +----------------------------------------------------------------------// | 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]>// +----------------------------------------------------------------------return [    // +----------------------------------------------------------------------    // | 應用設定    // +----------------------------------------------------------------------    // 應用命名空間    ‘app_namespace‘          => ‘app‘,    // 應用偵錯模式    ‘app_debug‘              => true,    // 應用Trace    ‘app_trace‘              => false,    // 應用模式狀態    ‘app_status‘             => ‘‘,    // 是否支援多模組    ‘app_multi_module‘       => true,    // 入口自動綁定模組    ‘auto_bind_module‘       => false,    // 註冊的根命名空間    ‘root_namespace‘         => [],    // 擴充函數檔案    ‘extra_file_list‘        => [THINK_PATH . ‘helper‘ . EXT],    // 預設輸出類型    ‘default_return_type‘    => ‘html‘,    // 預設AJAX 資料返回格式,可選json xml ...    ‘default_ajax_return‘    => ‘json‘,    // 預設JSONP格式返回的處理方法    ‘default_jsonp_handler‘  => ‘jsonpReturn‘,    // 預設JSONP處理方法    ‘var_jsonp_handler‘      => ‘callback‘,    // 預設時區    ‘default_timezone‘       => ‘PRC‘,    // 是否開啟多語言    ‘lang_switch_on‘         => false,    // 預設全域過濾方法 用逗號分隔多個    ‘default_filter‘         => ‘‘,    // 預設語言    ‘default_lang‘           => ‘zh-cn‘,    // 應用類庫尾碼    ‘class_suffix‘           => false,    // 控制器類尾碼    ‘controller_suffix‘      => false,    // +----------------------------------------------------------------------    // | 模組設定    // +----------------------------------------------------------------------    // 預設模組名    ‘default_module‘         => ‘index‘,    // 禁止訪問模組    ‘deny_module_list‘       => [‘common‘],    // 預設控制器名    ‘default_controller‘     => ‘Index‘,    // 預設操作名    ‘default_action‘         => ‘index‘,    // 預設驗證器    ‘default_validate‘       => ‘‘,    // 預設的空控制器名    ‘empty_controller‘       => ‘Error‘,    // 操作方法尾碼    ‘action_suffix‘          => ‘‘,    // 自動搜尋控制器    ‘controller_auto_search‘ => false,    // +----------------------------------------------------------------------    // | URL設定    // +----------------------------------------------------------------------    // PATHINFO變數名 用於相容模式    ‘var_pathinfo‘           => ‘s‘,    // 相容PATH_INFO擷取    ‘pathinfo_fetch‘         => [‘ORIG_PATH_INFO‘, ‘REDIRECT_PATH_INFO‘, ‘REDIRECT_URL‘],    // pathinfo分隔字元    ‘pathinfo_depr‘          => ‘/‘,    // URL偽靜態尾碼    ‘url_html_suffix‘        => ‘html‘,    // URL普通方式參數 用於自動產生    ‘url_common_param‘       => false,    // URL參數方式 0 按名稱成對解析 1 按順序解析    ‘url_param_type‘         => 0,    // 是否開啟路由    ‘url_route_on‘           => true,    // 路由使用完整匹配    ‘route_complete_match‘   => false,    // 路由設定檔(支援配置多個)    ‘route_config_file‘      => [‘route‘],    // 是否強制使用路由    ‘url_route_must‘         => false,    // 網域名稱部署    ‘url_domain_deploy‘      => false,    // 網域名稱根,如thinkphp.cn    ‘url_domain_root‘        => ‘‘,    // 是否自動轉換URL中的控制器和操作名    ‘url_convert‘            => true,    // 預設的存取控制器層    ‘url_controller_layer‘   => ‘controller‘,    // 表單請求類型偽裝變數    ‘var_method‘             => ‘_method‘,    // 表單ajax偽裝變數    ‘var_ajax‘               => ‘_ajax‘,    // 表單pjax偽裝變數    ‘var_pjax‘               => ‘_pjax‘,    // 是否開啟請求緩衝 true自動緩衝 支援佈建要求緩衝規則    ‘request_cache‘          => false,    // 請求緩衝有效期間    ‘request_cache_expire‘   => null,    // 全域請求緩衝排除規則    ‘request_cache_except‘   => [],    // +----------------------------------------------------------------------    // | 模板設定    // +----------------------------------------------------------------------    ‘template‘               => [        // 模板引擎類型 支援 php think 支援擴充        ‘type‘         => ‘Think‘,        // 模板路徑        ‘view_path‘    => ‘‘,        // 模板尾碼        ‘view_suffix‘  => ‘html‘,        // 模板檔案名稱分隔字元        ‘view_depr‘    => DS,        // 模板引擎普通標籤開始標記        ‘tpl_begin‘    => ‘{‘,        // 模板引擎普通標籤結束標記        ‘tpl_end‘      => ‘}‘,        // 標籤庫標籤開始標記        ‘taglib_begin‘ => ‘{‘,        // 標籤庫標籤結束標記        ‘taglib_end‘   => ‘}‘,    ],    // 視圖輸出字串內容替換    ‘view_replace_str‘       => [],    // 預設跳轉頁面對應的模板檔案    ‘dispatch_success_tmpl‘  => THINK_PATH . ‘tpl‘ . DS . ‘dispatch_jump.tpl‘,    ‘dispatch_error_tmpl‘    => THINK_PATH . ‘tpl‘ . DS . ‘dispatch_jump.tpl‘,    // +----------------------------------------------------------------------    // | 異常及錯誤設定    // +----------------------------------------------------------------------    // 異常頁面的模板檔案    ‘exception_tmpl‘         => THINK_PATH . ‘tpl‘ . DS . ‘think_exception.tpl‘,    // 錯誤顯示資訊,非偵錯模式有效    ‘error_message‘          => ‘分頁錯誤!請稍後再試~‘,    // 顯示錯誤資訊    ‘show_error_msg‘         => false,    // 異常處理handle類 留空使用 \think\exception\Handle    ‘exception_handle‘       => ‘‘,    // +----------------------------------------------------------------------    // | 日誌設定    // +----------------------------------------------------------------------    ‘log‘                    => [        // 日誌記錄方式,內建 file socket 支援擴充        ‘type‘  => ‘File‘,        // 日誌儲存目錄        ‘path‘  => LOG_PATH,        // 日誌記錄層級        ‘level‘ => [],    ],    // +----------------------------------------------------------------------    // | Trace設定 開啟 app_trace 後 有效    // +----------------------------------------------------------------------    ‘trace‘                  => [        // 內建Html Console 支援擴充        ‘type‘ => ‘Html‘,    ],    // +----------------------------------------------------------------------    // | 緩衝設定    // +----------------------------------------------------------------------    ‘cache‘                  => [        // 驅動方式        ‘type‘   => ‘File‘,        // 緩衝儲存目錄        ‘path‘   => CACHE_PATH,        // 緩衝首碼        ‘prefix‘ => ‘‘,        // 緩衝有效期間 0表示永久緩衝        ‘expire‘ => 0,    ],    // +----------------------------------------------------------------------    // | 會話設定    // +----------------------------------------------------------------------    ‘session‘                => [        ‘id‘             => ‘‘,        // SESSION_ID的提交變數,解決flash上傳跨域        ‘var_session_id‘ => ‘‘,        // SESSION 首碼        ‘prefix‘         => ‘think‘,        // 驅動方式 支援redis memcache memcached        ‘type‘           => ‘‘,        // 是否自動開啟 SESSION        ‘auto_start‘     => true,    ],    // +----------------------------------------------------------------------    // | Cookie設定    // +----------------------------------------------------------------------    ‘cookie‘                 => [        // cookie 名稱首碼        ‘prefix‘    => ‘‘,        // cookie 儲存時間        ‘expire‘    => 0,        // cookie 儲存路徑        ‘path‘      => ‘/‘,        // cookie 有效網域名稱        ‘domain‘    => ‘‘,        //  cookie 啟用安全傳輸        ‘secure‘    => false,        // httponly設定        ‘httponly‘  => ‘‘,        // 是否使用 setcookie        ‘setcookie‘ => true,    ],    //分頁配置    ‘paginate‘               => [        ‘type‘      => ‘bootstrap‘,        ‘var_page‘  => ‘page‘,        ‘list_rows‘ => 15,    ],];

 

thinkphp5 預設配置代碼

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.