database.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. use think\Env;
  12. return [
  13. // 数据库类型
  14. 'type' => Env::get('database.type', 'mysql'),
  15. // 服务器地址
  16. 'hostname' => Env::get('database.hostname', '101.200.198.249'),
  17. // 数据库名
  18. 'database' => Env::get('database.database', 'hxtc_sagoo_cn'),
  19. // 用户名
  20. 'username' => Env::get('database.username', 'hxtc_sagoo_cn'),
  21. // 密码
  22. 'password' => Env::get('database.password', 'b63jrp7a2TSBXcPn'),
  23. // 端口
  24. 'hostport' => Env::get('database.hostport', ''),
  25. // 连接dsn
  26. 'dsn' => '',
  27. // 数据库连接参数
  28. 'params' => [],
  29. // 数据库编码默认采用 utf8mb4
  30. 'charset' => Env::get('database.charset', 'utf8mb4'),
  31. // 数据库表前缀
  32. 'prefix' => Env::get('database.prefix', 'fa_'),
  33. // 数据库调试模式
  34. 'debug' => Env::get('database.debug', true),
  35. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  36. 'deploy' => 0,
  37. // 数据库读写是否分离 主从式有效
  38. 'rw_separate' => false,
  39. // 读写分离后 主服务器数量
  40. 'master_num' => 1,
  41. // 指定从服务器序号
  42. 'slave_no' => '',
  43. // 是否严格检查字段是否存在
  44. 'fields_strict' => true,
  45. // 数据集返回类型
  46. 'resultset_type' => 'array',
  47. // 自动写入时间戳字段
  48. 'auto_timestamp' => false,
  49. // 时间字段取出后的默认时间格式,默认为Y-m-d H:i:s
  50. 'datetime_format' => false,
  51. // 是否需要进行SQL性能分析
  52. 'sql_explain' => false,
  53. ];