参阅:
- $_config = array();
-
- // ---------------------------- CONFIG DB ----------------------------- //
- // ---------------------------- 数据库相关设置---------------------------- //
-
- /**
- * 数据库主服务器设置, 支持多组服务器设置, 当设置多组服务器时, 则会根据分布式策略使用某个服务器
- * @example
- * $_config['db']['1']['dbhost'] = 'localhost'; // 服务器地址
- * $_config['db']['1']['dbuser'] = 'root'; // 用户
- * $_config['db']['1']['dbpw'] = 'root';// 密码
- * $_config['db']['1']['dbcharset'] = 'gbk';// 字符集
- * $_config['db']['1']['pconnect'] = '0';// 是否持续连接
- * $_config['db']['1']['dbname'] = 'x1';// 数据库
- * $_config['db']['1']['tablepre'] = 'pre_';// 表名前缀
- *
- * $_config['db']['2']['dbhost'] = 'localhost';
- * ...
- *
- */
- $_config['db'][1]['dbhost'] = 'localhost';
- $_config['db'][1]['dbuser'] = 'root';
- $_config['db'][1]['dbpw'] = 'root';
- $_config['db'][1]['dbcharset'] = 'gbk';
- $_config['db'][1]['pconnect'] = 0;
- $_config['db'][1]['dbname'] = 'ultrax';
- $_config['db'][1]['tablepre'] = 'pre_';
-
- /**
- * 数据库从服务器设置( slave, 只读 ), 支持多组服务器设置, 当设置多组服务器时, 系统每次随机使用
- * @example
- * $_config['db']['slave']['1']['dbhost'] = 'localhost';
- * $_config['db']['slave']['1']['dbuser'] = 'root';
- * $_config['db']['slave']['1']['dbpw'] = 'root';
- * $_config['db']['slave']['1']['dbcharset'] = 'gbk';
- * $_config['db']['slave']['1']['pconnect'] = '0';
- * $_config['db']['slave']['1']['dbname'] = 'x1';
- * $_config['db']['slave']['1']['tablepre'] = 'pre_';
- *
- * $_config['db']['slave']['2']['dbhost'] = 'localhost';
- * ...
- *
- */
- $_config['db']['slave'] = array();
-
- /**
- * 数据库 分布部署策略设置
- *
- * @example 将 common_member 部署到第二服务器, common_session 部署在第三服务器, 则设置为
- * $_config['db']['map']['common_member'] = 2;
- * $_config['db']['map']['common_session'] = 3;
- *
- * 对于没有明确声明服务器的表, 则一律默认部署在第一服务器上
- *
- */
- $_config['db']['map'] = array();
-
- /**
- * 数据库 公共设置, 此类设置通常对针对每个部署的服务器
- */
- $_config['db']['common'] = array();
-
- /**
- * 禁用从数据库的数据表, 表名字之间使用逗号分割
- *
- * @example common_session, common_member 这两个表仅从主服务器读写, 不使用从服务器
- * $_config['db']['common']['slave_except_table'] = 'common_session, common_member';
- *
- */
- $_config['db']['common']['slave_except_table'] = '';
-
- /**
复制代码 |