This commit is contained in:
aozhiwei 2024-06-04 17:06:58 +08:00
parent bed78c8a89
commit f28a0487bc
2 changed files with 24 additions and 0 deletions

View File

@ -3,6 +3,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_mail_mysql_cluster = require('../config/mail.mysql.cluster.php');
$g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php');
$g_metatables = array();
@ -63,6 +64,12 @@ function getRelationMysqlConfig($hash_value)
return $g_conf_relation_mysql_cluster;
}
function getMailMysqlConfig()
{
global $g_conf_mail_mysql_cluster;
return $g_conf_mail_mysql_cluster;
}
function getRedisConfig($hash_value)
{
if ($hash_value < 0) {

View File

@ -7,6 +7,7 @@ class BaseController {
private $nowtime = 0;
private $marketDbConn = null;
private $relationDbConn = null;
private $mailDbConn = null;
private $timeOffset = 0;
private $serviceHash = array();
@ -151,6 +152,22 @@ class BaseController {
return $this->marketDbConn;
}
public function _getMailMysql()
{
if ($this->mailDbConn) {
return $this->mailDbConn;
}
$mysql_conf = getMailMysqlConfig();
$this->marketDbConn = new phpcommon\Mysql(array(
'host' => $mysql_conf['host'],
'port' => $mysql_conf['port'],
'user' => $mysql_conf['user'],
'passwd' => $mysql_conf['passwd'],
'dbname' => $mysql_conf['dbname'],
));
return $this->marketDbConn;
}
public function _getRelationDbMysql()
{
if ($this->relationDbConn) {