config.php 8.6 KB

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