dbrw.php 1.3 KB

1234567891011121314151617181920212223242526272829
  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. 'dbrm_open' =>Env::get('database.index_dbrm_open',false),
  15. 'hostname' => Env::get('database.index_hostname', ''),
  16. // 端口
  17. 'hostport' => Env::get('database.index_hostport', ''),
  18. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  19. 'deploy' => Env::get('database.index_deploy', 1),
  20. // 数据库读写是否分离 主从式有效
  21. 'rw_separate' => Env::get('database.index_rw_separate', true),
  22. // 读写分离后 主服务器数量
  23. 'master_num' => Env::get('database.index_master_num', 1),
  24. // 指定从服务器序号
  25. 'slave_no' => Env::get('database.index_slave_no', ''),
  26. ];