config.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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' => 'admin',
  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, 'huorisk' => HUORISK_PATH,
  32. 'huolib' => HUOLIB_PATH,
  33. 'huomp' => HUOMP_PATH, 'plugins' => PLUGINS_PATH],
  34. // 扩展函数文件
  35. 'extra_file_list' => [CMF_PATH.'common'.EXT, CMF_PATH.'view_common'.EXT, HUO_PATH.'common'.EXT,
  36. THINK_PATH.'helper'.EXT],
  37. // 默认输出类型
  38. 'default_return_type' => 'html',
  39. // 默认AJAX 数据返回格式,可选json xml ...
  40. 'default_ajax_return' => 'json',
  41. // 默认JSONP格式返回的处理方法
  42. 'default_jsonp_handler' => 'jsonpReturn',
  43. // 默认JSONP处理方法
  44. 'var_jsonp_handler' => 'callback',
  45. // 默认时区
  46. 'default_timezone' => 'PRC',
  47. // 是否开启多语言
  48. 'lang_switch_on' => true,
  49. // 默认全局过滤方法 用逗号分隔多个
  50. 'default_filter' => 'htmlspecialchars',
  51. // 默认语言
  52. 'default_lang' => 'zh-cn',
  53. // 允许的语言
  54. 'header_accept_lang' => ['en-us', 'zh-cn', 'ar'],
  55. // 应用类库后缀
  56. 'class_suffix' => true,
  57. // 控制器类后缀
  58. 'controller_suffix' => true,
  59. // +----------------------------------------------------------------------
  60. // | 模块设置
  61. // +----------------------------------------------------------------------
  62. // 默认模块名
  63. 'default_module' => 'admin',
  64. // 禁止访问模块
  65. 'deny_module_list' => ['common'],
  66. // 默认控制器名
  67. 'default_controller' => 'Index',
  68. // 默认操作名
  69. 'default_action' => 'index',
  70. // 默认验证器
  71. 'default_validate' => '',
  72. // 默认的空控制器名
  73. 'empty_controller' => 'Error',
  74. // 自动搜索控制器
  75. 'controller_auto_search' => true,
  76. // +----------------------------------------------------------------------
  77. // | URL设置
  78. // +----------------------------------------------------------------------
  79. 'pathinfo_depr' => '/',
  80. // URL伪静态后缀
  81. 'url_html_suffix' => 'html',
  82. // URL普通方式参数 用于自动生成
  83. 'url_common_param' => false,
  84. // URL参数方式 0 按名称成对解析 1 按顺序解析
  85. 'url_param_type' => 0,
  86. // 是否开启路由
  87. 'url_route_on' => true,
  88. // 路由配置文件(支持配置多个)
  89. 'route_config_file' => ['route'],
  90. // 是否强制使用路由
  91. 'url_route_must' => false,
  92. // 域名部署
  93. 'url_domain_deploy' => false,
  94. // 域名根,如thinkphp.cn
  95. 'url_domain_root' => '',
  96. // 是否自动转换URL中的控制器和操作名
  97. 'url_convert' => true,
  98. // 默认的访问控制器层
  99. 'url_controller_layer' => 'controller',
  100. // 表单请求类型伪装变量
  101. 'var_method' => '_method',
  102. // +----------------------------------------------------------------------
  103. // | 模板设置
  104. // +----------------------------------------------------------------------
  105. 'template' => [
  106. // 模板引擎类型 支持 php think 支持扩展
  107. 'type' => 'Think',
  108. // 视图根目录
  109. 'view_base' => '',
  110. // 模板路径
  111. 'view_path' => '',
  112. // 模板后缀
  113. 'view_suffix' => 'html',
  114. // 模板文件名分隔符
  115. 'view_depr' => DS,
  116. // 模板引擎普通标签开始标记
  117. 'tpl_begin' => '{',
  118. // 模板引擎普通标签结束标记
  119. 'tpl_end' => '}',
  120. // 标签库标签开始标记
  121. 'taglib_begin' => '<',
  122. // 标签库标签结束标记
  123. 'taglib_end' => '>',
  124. 'taglib_build_in' => 'cmf\lib\taglib\Cmf,cx',
  125. 'tpl_cache' => APP_DEBUG ? false : true,
  126. 'tpl_deny_php' => false
  127. ],
  128. // 视图输出字符串内容替换
  129. 'view_replace_str' => [],
  130. // 默认跳转页面对应的模板文件
  131. 'dispatch_success_tmpl' => THINK_PATH.'tpl'.DS.'dispatch_jump.tpl',
  132. 'dispatch_error_tmpl' => THINK_PATH.'tpl'.DS.'dispatch_jump.tpl',
  133. // +----------------------------------------------------------------------
  134. // | 异常及错误设置
  135. // +----------------------------------------------------------------------
  136. // 异常页面的模板文件
  137. 'exception_tmpl' => THINK_PATH.'tpl'.DS.'think_exception.tpl',
  138. // 错误显示信息,非调试模式有效
  139. 'error_message' => '页面错误!请稍后再试~',
  140. // 显示错误信息
  141. 'show_error_msg' => false,
  142. // 异常处理handle类 留空使用 \think\exception\Handle
  143. 'exception_handle' => '',
  144. // +----------------------------------------------------------------------
  145. // | Trace设置 开启 app_trace 后 有效
  146. // +----------------------------------------------------------------------
  147. 'trace' => [
  148. // 内置Html Console 支持扩展
  149. 'type' => 'Html',
  150. ],
  151. // +----------------------------------------------------------------------
  152. // | 会话设置
  153. // +----------------------------------------------------------------------
  154. 'session' => [
  155. 'id' => '',
  156. // SESSION_ID的提交变量,解决flash上传跨域
  157. 'var_session_id' => '',
  158. 'name' => 'ADMINSESSIONID',
  159. 'domain' => '',
  160. // SESSION 前缀
  161. 'prefix' => 'admin',
  162. 'expire' => '86400',
  163. // 驱动方式 支持redis memcache memcached
  164. 'type' => 'redis',
  165. // 是否自动开启 SESSION
  166. 'auto_start' => true,
  167. // redis主机
  168. 'host' => CACHE_HOST,
  169. // redis端口
  170. 'port' => 6379,
  171. // 密码
  172. 'password' => CACHE_PASSWORD,
  173. ],
  174. // +----------------------------------------------------------------------
  175. // | Cookie设置
  176. // +----------------------------------------------------------------------
  177. 'cookie' => [
  178. // cookie 名称前缀
  179. 'prefix' => 'huo',
  180. // cookie 保存时间
  181. 'expire' => 0,
  182. // cookie 保存路径
  183. 'path' => '/',
  184. // cookie 有效域名
  185. 'domain' => '',
  186. // cookie 启用安全传输
  187. 'secure' => false,
  188. // httponly设置
  189. 'httponly' => '',
  190. // 是否使用 setcookie
  191. 'setcookie' => true,
  192. ],
  193. // +----------------------------------------------------------------------
  194. // | 数据库设置
  195. // +----------------------------------------------------------------------
  196. 'database' => [
  197. // 数据库调试模式
  198. 'debug' => true,
  199. // 数据集返回类型
  200. 'resultset_type' => 'collection',
  201. // 自动写入时间戳字段
  202. 'auto_timestamp' => false,
  203. // 时间字段取出后的默认时间格式
  204. 'datetime_format' => false,
  205. // 是否需要进行SQL性能分析
  206. 'sql_explain' => false,
  207. ],
  208. //分页配置
  209. 'paginate' => [
  210. 'type' => '\cmf\paginator\Bootstrap',
  211. 'var_page' => 'page',
  212. 'list_rows' => 50,
  213. ],
  214. // +----------------------------------------------------------------------
  215. // | CMF 设置
  216. // +----------------------------------------------------------------------
  217. 'cmf_admin_theme_path' => '../themes/',
  218. 'cmf_admin_default_theme' => 'admin',
  219. ];
  220. return array_merge($_global_config, $configs);