This commit is contained in:
aozhiwei 2020-12-22 16:29:43 +08:00
parent 25f15652ac
commit 798cd5ad93
2 changed files with 40 additions and 1 deletions

@ -1 +1 @@
Subproject commit e5a5520599e28782e8f413891cf30a773c505ce8 Subproject commit 0fad7e8fc4d878dcf0a1fb61c585027555748fcf

View File

@ -0,0 +1,39 @@
<?php
class GMController {
function __construct()
{
if (SERVER_ENV == _ONLINE) {
die("can't create GMController");
return;
}
}
protected function getRedis($team_uuid)
{
$redis_conf = getRedisConfig(crc32($team_uuid));
$r = new phpcommon\Redis(array(
'host' => $redis_conf['host'],
'port' => $redis_conf['port'],
'passwd' => $redis_conf['passwd']
));
return $r;
}
protected function getMysql($account_id)
{
$mysql_conf = getMysqlConfig(crc32($account_id));
$conn = new phpcommon\Mysql(array(
'host' => $mysql_conf['host'],
'port' => $mysql_conf['port'],
'user' => $mysql_conf['user'],
'passwd' => $mysql_conf['passwd'],
'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id']
));
return $conn;
}
}