Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 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. use think\facade\Env;
  12. return [
  13. // 默认使用的数据库连接配置
  14. 'default' => Env::get('database.driver', 'mysql'),
  15. // 数据库连接配置信息
  16. 'connections' => [
  17. 'mysql' => [
  18. // 数据库类型
  19. 'type' => Env::get('database.type', 'mysql'),
  20. // 服务器地址
  21. 'hostname' => Env::get('database.hostname', '127.0.0.1'),
  22. // 数据库名
  23. 'database' => Env::get('database.database', 'crmeb'),
  24. // 用户名
  25. 'username' => Env::get('database.username', 'root'),
  26. // 密码
  27. 'password' => Env::get('database.password', 'root'),
  28. // 端口
  29. 'hostport' => Env::get('database.hostport', '3306'),
  30. // 连接dsn
  31. 'dsn' => '',
  32. // 数据库连接参数
  33. 'params' => [],
  34. // 数据库编码默认采用utf8
  35. 'charset' => Env::get('database.charset', 'utf8mb4'),
  36. // 数据库表前缀
  37. 'prefix' => Env::get('database.prefix', 'eb_'),
  38. // 数据库调试模式
  39. 'debug' => Env::get('database.debug', true),
  40. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  41. 'deploy' => 0,
  42. // 数据库读写是否分离 主从式有效
  43. 'rw_separate' => false,
  44. // 读写分离后 主服务器数量
  45. 'master_num' => 1,
  46. // 指定从服务器序号
  47. 'slave_no' => '',
  48. // 是否严格检查字段是否存在
  49. 'fields_strict' => true,
  50. // 字段缓存
  51. 'fields_cache' => !env('APP_DEBUG', false),
  52. // 是否需要进行SQL性能分析
  53. 'sql_explain' => false,
  54. // Builder类
  55. 'builder' => '',
  56. // Query类
  57. 'query' => '',
  58. // 是否需要断线重连
  59. 'break_reconnect' => true,
  60. ],
  61. // 更多的数据库配置信息
  62. ],
  63. // 自定义时间查询规则
  64. 'time_query_rule' => [],
  65. // 自动写入时间戳字段
  66. 'auto_timestamp' => 'timestamp',
  67. // 时间字段取出后的默认时间格式
  68. 'datetime_format' => 'Y-m-d H:i:s',
  69. //数据分页配置
  70. 'page' => [
  71. //页码key
  72. 'pageKey' => 'page',
  73. //每页截取key
  74. 'limitKey' => 'limit',
  75. //每页截取最大值
  76. 'limitMax' => 100,
  77. //默认条数
  78. 'defaultLimit' => 10,
  79. ]
  80. ];