diff --git a/third_party/phpcommon b/third_party/phpcommon index e5a55205..0fad7e8f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit e5a5520599e28782e8f413891cf30a773c505ce8 +Subproject commit 0fad7e8fc4d878dcf0a1fb61c585027555748fcf diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php new file mode 100644 index 00000000..49cb1fec --- /dev/null +++ b/webapp/controller/GMController.class.php @@ -0,0 +1,39 @@ + $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; + } + +}