config.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <?php
  2. /**
  3. * config.php UTF-8
  4. * 配置文件
  5. *
  6. * @date : 2018/9/20 11:29
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HuoMp 1.0
  11. */
  12. if (file_exists(GLOBAL_CONF_PATH."config.php")) {
  13. $_global_config = include GLOBAL_CONF_PATH."config.php";
  14. } else {
  15. $_global_config = [];
  16. }
  17. $configs = [
  18. // +----------------------------------------------------------------------
  19. // | 应用设置
  20. // +----------------------------------------------------------------------
  21. // 应用命名空间
  22. 'app_namespace' => 'web',
  23. // 应用模式状态
  24. 'app_status' => APP_DEBUG ? 'debug' : 'release',
  25. // 是否支持多模块
  26. 'app_multi_module' => true,
  27. // 入口自动绑定模块
  28. 'auto_bind_module' => false,
  29. // 注册的根命名空间
  30. 'root_namespace' => ['cmf' => CMF_PATH, 'huo' => HUO_PATH, 'plugins' => PLUGINS_PATH,
  31. 'app' => CMF_PATH.'app/', 'huolib' => HUOLIB_PATH],
  32. // 扩展函数文件
  33. 'extra_file_list' => [THINK_PATH.'helper'.EXT, CMF_PATH.'common'.EXT, HUO_PATH.'common'.EXT],
  34. // 默认输出类型
  35. 'default_return_type' => 'html',
  36. // 默认AJAX 数据返回格式,可选json xml ...
  37. 'default_ajax_return' => 'json',
  38. // 默认JSONP格式返回的处理方法
  39. 'default_jsonp_handler' => 'jsonpReturn',
  40. // 默认JSONP处理方法
  41. 'var_jsonp_handler' => 'callback',
  42. // 默认时区
  43. 'default_timezone' => 'PRC',
  44. // 是否开启多语言
  45. 'lang_switch_on' => true,
  46. // 默认全局过滤方法 用逗号分隔多个
  47. 'default_filter' => 'htmlspecialchars',
  48. // 默认语言
  49. 'default_lang' => 'en-us',
  50. // 允许的语言
  51. 'header_accept_lang' => ['en', 'zh', 'ar'],
  52. // 应用类库后缀
  53. 'class_suffix' => true,
  54. // 控制器类后缀
  55. 'controller_suffix' => true,
  56. // +----------------------------------------------------------------------
  57. // | 模块设置
  58. // +----------------------------------------------------------------------
  59. // 默认模块名
  60. 'default_module' => 'pc',
  61. // 禁止访问模块
  62. 'deny_module_list' => ['common'],
  63. // 默认控制器名
  64. 'default_controller' => 'Index',
  65. // 默认操作名
  66. 'default_action' => 'Index',
  67. // 默认验证器
  68. 'default_validate' => '',
  69. // 默认的空控制器名
  70. 'empty_controller' => 'Error',
  71. // 自动搜索控制器
  72. 'controller_auto_search' => false,
  73. // +----------------------------------------------------------------------
  74. // | URL设置
  75. // +----------------------------------------------------------------------
  76. 'pathinfo_depr' => '/',
  77. // URL伪静态后缀
  78. 'url_html_suffix' => 'html',
  79. // URL普通方式参数 用于自动生成
  80. 'url_common_param' => false,
  81. // URL参数方式 0 按名称成对解析 1 按顺序解析
  82. 'url_param_type' => 0,
  83. // 是否开启路由
  84. 'url_route_on' => true,
  85. // 路由配置文件(支持配置多个)
  86. 'route_config_file' => ['route'],
  87. // 是否强制使用路由
  88. 'url_route_must' => false,
  89. // 域名部署
  90. 'url_domain_deploy' => false,
  91. // 域名根,如thinkphp.cn
  92. 'url_domain_root' => '',
  93. // 是否自动转换URL中的控制器和操作名
  94. 'url_convert' => true,
  95. // 默认的访问控制器层
  96. 'url_controller_layer' => 'controller',
  97. // 表单请求类型伪装变量
  98. 'var_method' => '_method',
  99. // +----------------------------------------------------------------------
  100. // | 模板设置
  101. // +----------------------------------------------------------------------
  102. 'template' => [
  103. // 模板引擎类型 支持 php think 支持扩展
  104. 'type' => 'Think',
  105. // 视图根目录
  106. 'view_base' => '',
  107. // 模板路径
  108. 'view_path' => '',
  109. // 模板后缀
  110. 'view_suffix' => 'html',
  111. // 模板文件名分隔符
  112. 'view_depr' => DS,
  113. // 模板引擎普通标签开始标记
  114. 'tpl_begin' => '{',
  115. // 模板引擎普通标签结束标记
  116. 'tpl_end' => '}',
  117. // 标签库标签开始标记
  118. 'taglib_begin' => '<',
  119. // 标签库标签结束标记
  120. 'taglib_end' => '>',
  121. ],
  122. // 视图输出字符串内容替换
  123. 'view_replace_str' => [],
  124. // 默认跳转页面对应的模板文件
  125. 'dispatch_success_tmpl' => THINK_PATH.'tpl'.DS.'dispatch_jump.tpl',
  126. 'dispatch_error_tmpl' => THINK_PATH.'tpl'.DS.'dispatch_jump.tpl',
  127. // +----------------------------------------------------------------------
  128. // | 异常及错误设置
  129. // +----------------------------------------------------------------------
  130. // 异常页面的模板文件
  131. 'exception_tmpl' => THINK_PATH.'tpl'.DS.'think_exception.tpl',
  132. // 错误显示信息,非调试模式有效
  133. 'error_message' => '页面错误!请稍后再试~',
  134. // 显示错误信息
  135. 'show_error_msg' => false,
  136. // 异常处理handle类 留空使用 \think\exception\Handle
  137. 'exception_handle' => '',
  138. // +----------------------------------------------------------------------
  139. // | 日志设置
  140. // +----------------------------------------------------------------------
  141. 'log' => [
  142. // 日志记录方式,内置 file socket 支持扩展
  143. 'type' => 'File',
  144. // 日志保存目录
  145. 'path' => LOG_PATH,
  146. // 日志记录级别
  147. 'level' => [],
  148. ],
  149. // +----------------------------------------------------------------------
  150. // | Trace设置 开启 app_trace 后 有效
  151. // +----------------------------------------------------------------------
  152. 'trace' => [
  153. // 内置Html Console 支持扩展
  154. 'type' => 'Html',
  155. ],
  156. // +----------------------------------------------------------------------
  157. // | Cookie设置
  158. // +----------------------------------------------------------------------
  159. 'cookie' => [
  160. // cookie 名称前缀
  161. 'prefix' => '',
  162. // cookie 保存时间
  163. 'expire' => 0,
  164. // cookie 保存路径
  165. 'path' => '/',
  166. // cookie 有效域名
  167. 'domain' => '',
  168. // cookie 启用安全传输
  169. 'secure' => false,
  170. // httponly设置
  171. 'httponly' => '',
  172. // 是否使用 setcookie
  173. 'setcookie' => true,
  174. ],
  175. // +----------------------------------------------------------------------
  176. // | 数据库设置
  177. // +----------------------------------------------------------------------
  178. 'database' => [
  179. // 数据库调试模式
  180. 'debug' => true,
  181. // 数据集返回类型
  182. 'resultset_type' => 'collection',//collection
  183. // 自动写入时间戳字段
  184. 'auto_timestamp' => false,
  185. // 时间字段取出后的默认时间格式
  186. 'datetime_format' => false,
  187. // 是否需要进行SQL性能分析
  188. 'sql_explain' => false,
  189. ],
  190. //分页配置
  191. 'paginate' => [
  192. 'type' => '\cmf\paginator\Bootstrap',
  193. 'var_page' => 'page',
  194. 'list_rows' => 15,
  195. ],
  196. //图片验证码
  197. 'captcha' => [
  198. // 验证码字符集合
  199. 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
  200. // 验证码字体大小(px)
  201. 'fontSize' => 25,
  202. // 是否画混淆曲线
  203. 'useCurve' => true,
  204. // 验证码图片高度
  205. 'imageH' => 30,
  206. // 验证码图片宽度
  207. 'imageW' => 100,
  208. // 验证码位数
  209. 'length' => 5,
  210. // 验证成功后是否重置
  211. 'reset' => true
  212. ],
  213. // +----------------------------------------------------------------------
  214. // | CMF 设置
  215. // +----------------------------------------------------------------------
  216. 'cmf_theme_path' => '../themes/pc',
  217. 'cmf_default_theme' => '',
  218. 'cmf_admin_theme_path' => 'themes/',
  219. 'cmf_admin_default_theme' => 'web_simpleboot3',
  220. ];
  221. return array_merge($configs, $_global_config);