config.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. return [
  12. // +----------------------------------------------------------------------
  13. // | 模板文件设置
  14. // +----------------------------------------------------------------------
  15. //表单生成器模板
  16. 'full_builder_layout' => APP_PATH . 'common/builder/full_layout.htm',
  17. //自动表单 前台wap列表页母模板
  18. 'automodel_listpage'=>APP_PATH.'common/builder/listpage/layout.htm',
  19. //自动表单 会员中心列表页母模板
  20. 'automodel_userlistpage'=>APP_PATH.'common/builder/listpage/user_layout.htm',
  21. //自动表单 前台wap详情展示页母模板
  22. 'automodel_showpage'=>APP_PATH.'common/builder/showpage/layout.htm',
  23. //后台公共布局母模板
  24. 'admin_style_layout' => APP_PATH . 'admin/view/layout.htm',
  25. //前台公共布局母模板
  26. //'index_style_layout' => APP_PATH . 'index/view/default/layout.htm',
  27. //会员中心公共布局母模板
  28. 'member_style_layout' => APP_PATH . 'member/view/default/layout.htm',
  29. //自动布局模板
  30. //'auto_tpl_base_layout' => APP_PATH . 'member/view/default/layout.htm',
  31. //基础模板
  32. 'site_defalut_html' => APP_PATH . 'common/builder/default.htm',
  33. //简朴模板
  34. 'simple_layout' => APP_PATH . 'common/view/simple_layout.htm',
  35. 'dispatch_success_tmpl' => APP_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
  36. 'dispatch_error_tmpl' => APP_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
  37. // +----------------------------------------------------------------------
  38. // | 验证码设置
  39. // +----------------------------------------------------------------------
  40. 'captcha' => [
  41. // 验证码密钥
  42. 'seKey' => 'fdsa3453fz',
  43. // 验证码图片高度
  44. 'imageH' => 34,
  45. // 验证码图片宽度
  46. 'imageW' => 130,
  47. // 验证码字体大小(px)
  48. 'fontSize' => 18,
  49. // 验证码位数
  50. 'length' => 4,
  51. ],
  52. // +----------------------------------------------------------------------
  53. // | 应用设置
  54. // +----------------------------------------------------------------------
  55. // 插件目录路径
  56. 'plugin_path' => ROOT_PATH. 'plugins/',
  57. // 数据包目录路径
  58. 'packet_path' => ROOT_PATH. 'packet/',
  59. // 文件上传路径
  60. 'upload_path' => ROOT_PATH . 'public' . DS . 'uploads',
  61. // 文件上传临时目录
  62. 'upload_temp_path' => ROOT_PATH . 'public' . DS . 'uploads' . DS . 'temp/',
  63. // 升级日志文件
  64. 'client_upgrade_edition' => RUNTIME_PATH . '/client_upgrade_edition.php',
  65. // 应用命名空间
  66. 'app_namespace' => 'app',
  67. // 应用调试模式
  68. 'app_debug' => false,
  69. // 应用Trace
  70. 'app_trace' => false,
  71. // 应用模式状态
  72. 'app_status' => '',
  73. // 是否支持多模块
  74. 'app_multi_module' => true,
  75. // 入口自动绑定模块
  76. 'auto_bind_module' => false,
  77. // 注册的根命名空间
  78. 'root_namespace' => ['plugins' => ROOT_PATH. 'plugins/','QCloud_WeApp_SDK' => ROOT_PATH. 'vendor/weapp-sdk/lib/'],
  79. // 扩展函数文件
  80. 'extra_file_list' => [THINK_PATH . 'helper' . EXT],
  81. // 用户密码加密方式,一旦设置好,就不能修改 可选1,2,3
  82. 'md5_pwd_type' => 0,
  83. // 默认输出类型
  84. 'default_return_type' => 'html',
  85. // 默认PJAX 数据返回格式,可选json xml ...
  86. 'default_pjax_return' => 'html',
  87. // 默认AJAX 数据返回格式,可选json xml ...
  88. 'default_ajax_return' => 'json',
  89. // 默认JSONP格式返回的处理方法
  90. 'default_jsonp_handler' => 'jsonpReturn',
  91. // 默认JSONP处理方法
  92. 'var_jsonp_handler' => 'callback',
  93. // 默认时区
  94. 'default_timezone' => 'PRC',
  95. // 是否开启多语言
  96. 'lang_switch_on' => false,
  97. // 默认全局过滤方法 用逗号分隔多个
  98. 'default_filter' => '',
  99. // 默认语言
  100. 'default_lang' => 'zh-cn',
  101. // 应用类库后缀
  102. 'class_suffix' => false,
  103. // 控制器类后缀
  104. 'controller_suffix' => false,
  105. // +----------------------------------------------------------------------
  106. // | 模块设置
  107. // +----------------------------------------------------------------------
  108. // 默认模块名
  109. 'default_module' => 'index',
  110. // 禁止访问模块
  111. 'deny_module_list' => ['common'],
  112. // 默认控制器名
  113. 'default_controller' => 'Index',
  114. // 默认操作名
  115. 'default_action' => 'index',
  116. // 默认验证器
  117. 'default_validate' => '',
  118. // 默认的空控制器名
  119. 'empty_controller' => 'Error',
  120. // 操作方法后缀
  121. 'action_suffix' => '',
  122. // 自动搜索控制器
  123. 'controller_auto_search' => false,
  124. // +----------------------------------------------------------------------
  125. // | URL设置
  126. // +----------------------------------------------------------------------
  127. // PATHINFO变量名 用于兼容模式
  128. 'var_pathinfo' => 's',
  129. // 兼容PATH_INFO获取
  130. 'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
  131. // pathinfo分隔符
  132. 'pathinfo_depr' => '/',
  133. // URL伪静态后缀
  134. 'url_html_suffix' => 'html',
  135. // URL普通方式参数 用于自动生成
  136. 'url_common_param' => false,
  137. // URL参数方式 0 按名称成对解析 1 按顺序解析
  138. 'url_param_type' => 0,
  139. // 是否开启路由
  140. 'url_route_on' => true,
  141. // 路由使用完整匹配
  142. 'route_complete_match' => false,
  143. // 路由配置文件(支持配置多个)
  144. 'route_config_file' => ['route'],
  145. // 是否强制使用路由
  146. 'url_route_must' => false,
  147. // 域名部署
  148. 'url_domain_deploy' => false,
  149. // 域名根,如thinkphp.cn
  150. 'url_domain_root' => '',
  151. // 是否自动转换URL中的控制器和操作名
  152. 'url_convert' => true,
  153. // 默认的访问控制器层
  154. 'url_controller_layer' => 'controller',
  155. // 表单请求类型伪装变量
  156. 'var_method' => '_method',
  157. // 表单ajax伪装变量
  158. 'var_ajax' => '_ajax',
  159. // 表单pjax伪装变量
  160. 'var_pjax' => '_pjax',
  161. // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
  162. 'request_cache' => false,
  163. // 请求缓存有效期
  164. 'request_cache_expire' => null,
  165. // 全局请求缓存排除规则
  166. 'request_cache_except' => [],
  167. // +----------------------------------------------------------------------
  168. // | 模板设置
  169. // +----------------------------------------------------------------------
  170. 'template' => [
  171. // 模板引擎类型 支持 php think 支持扩展
  172. 'type' => 'Think',
  173. // 模板路径
  174. 'view_path' => '',
  175. // 模板后缀
  176. 'view_suffix' => 'htm',
  177. // 模板文件名分隔符
  178. 'view_depr' => DS,
  179. // 模板引擎普通标签开始标记
  180. 'tpl_begin' => '{',
  181. // 模板引擎普通标签结束标记
  182. 'tpl_end' => '}',
  183. // 标签库标签开始标记
  184. 'taglib_begin' => '{',
  185. // 标签库标签结束标记
  186. 'taglib_end' => '}',
  187. 'taglib_pre_load' => 'app\common\taglib\Qb',
  188. //'taglib_build_in' => 'cx,app\common\taglib\Demo'
  189. ],
  190. // 视图输出字符串内容替换
  191. 'view_replace_str' => [],
  192. // 默认跳转页面对应的模板文件
  193. 'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
  194. 'dispatch_error_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
  195. // +----------------------------------------------------------------------
  196. // | 异常及错误设置
  197. // +----------------------------------------------------------------------
  198. // 异常页面的模板文件
  199. 'exception_tmpl' => THINK_PATH . 'tpl' . DS . 'think_exception.tpl',
  200. // 错误显示信息,非调试模式有效
  201. 'error_message' => '页面错误!请稍后再试~',
  202. // 显示错误信息
  203. 'show_error_msg' => false,
  204. // 异常处理handle类 留空使用 \think\exception\Handle
  205. 'exception_handle' => '',
  206. // +----------------------------------------------------------------------
  207. // | 日志设置
  208. // +----------------------------------------------------------------------
  209. 'log' => [
  210. // 日志记录方式,内置 file socket 支持扩展
  211. 'type' => 'test', //File 参数代表写日志 test 代表关闭日志,以节省磁盘空间
  212. // 日志保存目录
  213. 'path' => LOG_PATH,
  214. // 日志记录级别
  215. 'level' => ['error','sql'],
  216. 'max_files' => 10, //日志文件最多只会保留10个
  217. ],
  218. // +----------------------------------------------------------------------
  219. // | Trace设置 开启 app_trace 后 有效
  220. // +----------------------------------------------------------------------
  221. 'trace' => [
  222. // 内置Html Console 支持扩展
  223. 'type' => 'Html',
  224. ],
  225. // +----------------------------------------------------------------------
  226. // | 缓存设置
  227. // +----------------------------------------------------------------------
  228. 'cache' => [
  229. // 驱动方式
  230. 'type' => 'File',
  231. // 缓存保存目录
  232. 'path' => CACHE_PATH,
  233. // 缓存前缀
  234. 'prefix' => '',
  235. // 缓存有效期 0表示永久缓存
  236. 'expire' => 0,
  237. ],
  238. // +----------------------------------------------------------------------
  239. // | 会话设置
  240. // +----------------------------------------------------------------------
  241. 'session' => [
  242. 'id' => '',
  243. // SESSION_ID的提交变量,解决flash上传跨域
  244. 'var_session_id' => '',
  245. // SESSION 前缀
  246. 'prefix' => 'think',
  247. // 驱动方式 支持redis memcache memcached
  248. 'type' => '',
  249. // 是否自动开启 SESSION
  250. 'auto_start' => true,
  251. ],
  252. // +----------------------------------------------------------------------
  253. // | Cookie设置
  254. // +----------------------------------------------------------------------
  255. 'cookie' => [
  256. // cookie 名称前缀
  257. 'prefix' => '',
  258. // cookie 保存时间
  259. 'expire' => 0,
  260. // cookie 保存路径
  261. 'path' => '/',
  262. // cookie 有效域名
  263. 'domain' => '',
  264. // cookie 启用安全传输
  265. 'secure' => false,
  266. // httponly设置
  267. 'httponly' => '',
  268. // 是否使用 setcookie
  269. 'setcookie' => true,
  270. ],
  271. //分页配置
  272. //'paginate' => [
  273. // 'type' => 'bootstrap',
  274. // 'var_page' => 'page',
  275. // 'list_rows' => 15,
  276. //],
  277. 'paginate' => [
  278. 'type' => 'page\Page',//分页类
  279. 'var_page' => 'page',
  280. 'list_rows' => 15,
  281. ],
  282. ];