diff --git a/webapp/bootstrap/config_loader.php b/webapp/bootstrap/config_loader.php index df46e91c..b3204f33 100644 --- a/webapp/bootstrap/config_loader.php +++ b/webapp/bootstrap/config_loader.php @@ -2,6 +2,7 @@ $g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.php'); $g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php'); +$g_conf_relation_mysql_cluster = require('../config/game2006relation.mysql.cluster.php'); $g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php'); $g_metatables = array(); @@ -52,6 +53,16 @@ function getMarketMysqlConfig($hash_value) return $g_conf_market_mysql_cluster; } +function getRelationMysqlConfig($hash_value) +{ + if ($hash_value < 0) { + error_log('callstack:' . json_encode(debug_backtrace(), JSON_PRETTY_PRINT)); + die('hash_value < 0 ' . $hash_value); + } + global $g_conf_relation_mysql_cluster; + return $g_conf_relation_mysql_cluster; +} + function getRedisConfig($hash_value) { if ($hash_value < 0) { diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 61599f7f..316feccf 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -130,7 +130,7 @@ class BaseController { if ($this->relationDbConn) { return $this->relationDbConn; } - $mysql_conf = getMarketMysqlConfig(crc32('')); + $mysql_conf = getRelationMysqlConfig(crc32('')); $this->relationDbConn = new phpcommon\Mysql(array( 'host' => $mysql_conf['host'], 'port' => $mysql_conf['port'],