254 lines
8.7 KiB
PHP
254 lines
8.7 KiB
PHP
<?php
|
||
/**
|
||
* Created by PhpStorm.
|
||
* User: abcdefg
|
||
* Date: 2016-08-11
|
||
* Time: 10:10
|
||
*/
|
||
|
||
require_once __DIR__ . '/CommonConstant.php';
|
||
|
||
/// 是否调试环境
|
||
define('DEBUG_MODE', false);
|
||
|
||
if (DEBUG_MODE)
|
||
{
|
||
/// 数据库类型(mysql, sqlsrv, oracle)
|
||
define('DATABASE_TYPE', DATABASE_TYPE_MYSQL);
|
||
/// ==== ↓ 主服务器信息 ↓ ====
|
||
//define('MASTER_DATABASE', '');
|
||
/// 主服务器数
|
||
//define('MASTER_COUNT', 1);
|
||
/// 数据服务器地址
|
||
define('MASTER_HOSTNAME', '39.108.82.197');
|
||
/// 数据端口
|
||
define('MASTER_HOSTPORT', 3309);
|
||
/// 数据库登录用户名
|
||
define('MASTER_USERNAME', 'root');
|
||
/// 数据库登录密码
|
||
define('MASTER_PASSWORD', 'root_root');
|
||
/// 数据库名
|
||
define('MASTER_DATABASE', 'game_db');
|
||
/// 是否长链接
|
||
define('MASTER_PERSISTENT', false);
|
||
/// 编码(mysql有效)
|
||
define('MASTER_CHARSET', 'utf8');
|
||
/// ==== ↑ 主服务器信息 ↑ ====
|
||
|
||
/// ==== ↓ 从服务器信息 ↓ ====
|
||
/// 从服务器数
|
||
define('SERVANT_COUNT', 0);
|
||
|
||
/// ==== ↓ 从服务器1 ↓ ====
|
||
/// 数据服务器地址
|
||
define('SERVANT_HOSTNAME_0', '39.108.82.197');
|
||
/// 数据端口
|
||
define('SERVANT_HOSTPORT_0', 3309);
|
||
/// 数据库登录用户名
|
||
define('SERVANT_USERNAME_0', 'root');
|
||
/// 数据库登录密码
|
||
define('SERVANT_PASSWORD_0', 'root_root');
|
||
/// 数据库名
|
||
define('SERVANT_DATABASE_0', 'game_db');
|
||
/// 是否长链接
|
||
define('SERVANT_PERSISTENT_0', false);
|
||
/// 编码(mysql有效)
|
||
define('SERVANT_CHARSET_0', 'utf8');
|
||
/// ==== ↑ 从服务器1 ↑ ====
|
||
|
||
/// ==== ↑ 从服务器信息 ↑ ====
|
||
|
||
|
||
/// ==== ↓ redis配置 ↓ ====
|
||
/// 是否启用redis缓存
|
||
define('REDIS_ENABLED', false);
|
||
/// redis服务器名、地址
|
||
define('REDIS_HOSTNAME', 'localhost');
|
||
/// redis服务器端口
|
||
define('REDIS_HOSTPORT', 6379);
|
||
/// redis数据库名
|
||
define('REDIS_DATABASE', 'default');
|
||
/// redis密码
|
||
define('REDIS_PASSWORD', '123456');
|
||
/// ==== ↑ redis配置 ↑ ====
|
||
|
||
|
||
/// ==== ↓ 其他配置 ↓ ====
|
||
/// 服务器是否对外开放
|
||
define('SERVER_ACTIVE', true);
|
||
/// 当服务器不对外开放时,可以访问服务器的地址
|
||
define('INTERNAL_WHITELIST', 'return array(\'localhost\', \'127.0.0.1\', \'::1\', \'171.34.213.95\', );');
|
||
|
||
/// 服务器是否需要定时关闭
|
||
define('TIMED_OFF_NEEDED', false);
|
||
/// 定时关闭开始时间
|
||
define('TIMED_OFF_BEGIN', '02:50:00');
|
||
/// 定时关闭结束时间
|
||
define('TIMED_OFF_END', '08:00:00');
|
||
|
||
/// 是否需要校验token
|
||
define('TOKEN_ENABLED', false);
|
||
/// 限制token是否只能单次使用
|
||
define('TOKEN_SIGNLE', true);
|
||
|
||
/// 是否校验token和user_id是否匹配
|
||
define('VALID_TOKEN_USERID', false);
|
||
|
||
/// 是否需要验证签名
|
||
define('SIGN_ENABLED', false);
|
||
/// 签名key
|
||
define('SIGN_KEY', 'sdk');
|
||
|
||
/// 单个接口访问的时间间隔(毫秒)
|
||
define('REQUEST_INTERVAL', 10);
|
||
/// token超时时间(秒)
|
||
define('TOKEN_EXPIRE_TICK_COUNT', 7200);
|
||
|
||
/// 登录接口名(表示该接口为登录接口,登录接口不校验user_auth_token参数)
|
||
define('LOGIN_METHOD_LIST', 'return array(\'sales.sales.loginByPhone\', \'Admin.Admin.login\', \'agent.demand.salesInfo\', \'agent.user.getinfo\', \'agent.user.login\', \'agent.player.login\', \'agent.user.admin_login\', \'agent.user.report_login\', \'agent.user.getPlayer\');');
|
||
|
||
/// 不校验也不生成user_auth_token的接口列表
|
||
define('IGNORE_USER_AUTH_TOKEN_METHOD_LIST', 'return array(\'agent.user.getUserInfo\', \'admin.Admin.createAgent\', \'Admin.Admin.createChannel\', \'Admin.Admin.createGame\', \'agent.gift.newrechargecard\', \'report.report.areaNumberOfPeopleMap\', \'sales.sales.captchaLogin\', \'youle.youle.channelConfigById\', \'agent.user.whiteList\', \'agent.user.changeWhiteList\', \'agent.user.queryShortNum\', \'agent.order.createStarOrder\', \'agent.order.buyStarRecord\', \'Youle.Youle.productList\', \'agent.order.isPay\', \'report.report.exportReport\', \'Youle.Youle.webLog\', \'Youle.Youle.channelConfig\', \'Youle.Youle.gameList\', \'Youle.Youle.channelList\', \'sms.sms.sendBindCode\', \'agent.order.ordersuccess\', \'agent.game.downList\', );');
|
||
/// ==== ↑ 其他配置 ↑ ====
|
||
}
|
||
else
|
||
{
|
||
/// 数据库类型(mysql, sqlsrv, oracle)
|
||
define('DATABASE_TYPE', DATABASE_TYPE_MYSQL);
|
||
|
||
/// ==== ↓ 主服务器信息 ↓ ====
|
||
//define('MASTER_DATABASE', '');
|
||
/// 主服务器数
|
||
//define('MASTER_COUNT', 1);
|
||
/// 数据服务器地址
|
||
define('MASTER_HOSTNAME', 'rm-bp1btyuwq77591x0jpo.mysql.rds.aliyuncs.com');
|
||
//define('MASTER_HOSTNAME', 'rm-wz978o3vha6z26m5nrw.mysql.rds.aliyuncs.com');
|
||
/// 数据端口
|
||
define('MASTER_HOSTPORT', 3306);
|
||
/// 数据库登录用户名
|
||
define('MASTER_USERNAME', 'games');
|
||
/// 数据库登录密码
|
||
define('MASTER_PASSWORD', 'Games0791!!');
|
||
/// 数据库名
|
||
define('MASTER_DATABASE', 'agent_db');
|
||
/// 是否长链接
|
||
define('MASTER_PERSISTENT', false);
|
||
/// 编码(mysql有效)
|
||
define('MASTER_CHARSET', 'utf8');
|
||
/// ==== ↑ 主服务器信息 ↑ ====
|
||
|
||
/// ==== ↓ 从服务器信息 ↓ ====
|
||
/// 从服务器数
|
||
define('SERVANT_COUNT', 0);
|
||
|
||
/// ==== ↓ 从服务器1 ↓ ====
|
||
/// 数据服务器地址
|
||
define('SERVANT_HOSTNAME_0', 'rr-wz9v0rl1uv6o1j9pfo.mysql.rds.aliyuncs.com');
|
||
//define('SERVANT_HOSTNAME_0', 'rm-wz978o3vha6z26m5nrw.mysql.rds.aliyuncs.com');
|
||
/// 数据端口
|
||
define('SERVANT_HOSTPORT_0', 3306);
|
||
/// 数据库登录用户名
|
||
define('SERVANT_USERNAME_0', 'yunuser');
|
||
/// 数据库登录密码
|
||
define('SERVANT_PASSWORD_0', 'Yun_User');
|
||
/// 数据库名
|
||
define('SERVANT_DATABASE_0', 'game_db');
|
||
/// 是否长链接
|
||
define('SERVANT_PERSISTENT_0', false);
|
||
/// 编码(mysql有效)
|
||
define('SERVANT_CHARSET_0', 'utf8');
|
||
/// ==== ↑ 从服务器1 ↑ ====
|
||
|
||
/// ==== ↑ 从服务器信息 ↑ ====
|
||
|
||
|
||
/// ==== ↓ redis配置 ↓ ====
|
||
/// 是否启用redis缓存
|
||
define('REDIS_ENABLED', false);
|
||
/// redis服务器名、地址
|
||
define('REDIS_HOSTNAME', 'localhost');
|
||
/// redis服务器端口
|
||
define('REDIS_HOSTPORT', 6379);
|
||
/// redis数据库名
|
||
define('REDIS_DATABASE', 'default');
|
||
/// redis密码
|
||
define('REDIS_PASSWORD', '123456');
|
||
/// ==== ↑ redis配置 ↑ ====
|
||
|
||
|
||
/// ==== ↓ 其他配置 ↓ ====
|
||
/// 服务器是否对外开放
|
||
define('SERVER_ACTIVE', true);
|
||
/// 当服务器不对外开放时,可以访问服务器的地址
|
||
define('INTERNAL_WHITELIST', 'return array(\'localhost\', \'127.0.0.1\', \'::1\', \'171.34.213.95\', );');
|
||
|
||
/// 服务器是否需要定时关闭
|
||
define('TIMED_OFF_NEEDED', true);
|
||
/// 定时关闭开始时间
|
||
define('TIMED_OFF_BEGIN', '02:50:00');
|
||
/// 定时关闭结束时间
|
||
define('TIMED_OFF_END', '03:10:00');
|
||
|
||
/// 是否需要校验token
|
||
define('TOKEN_ENABLED', true);
|
||
/// 限制token是否只能单次使用
|
||
define('TOKEN_SIGNLE', true);
|
||
|
||
/// 是否校验token和user_id是否匹配
|
||
define('VALID_TOKEN_USERID', false);
|
||
|
||
/// 是否需要验证签名
|
||
define('SIGN_ENABLED', false);
|
||
/// 签名key
|
||
define('SIGN_KEY', 'sdk');
|
||
|
||
/// 单个接口访问的时间间隔(毫秒)
|
||
define('REQUEST_INTERVAL', 10);
|
||
/// token超时时间(秒)
|
||
define('TOKEN_EXPIRE_TICK_COUNT', 7200);
|
||
|
||
/// 登录接口名(表示该接口为登录接口,登录接口不校验user_auth_token参数)
|
||
define('LOGIN_METHOD_LIST', 'return array(\'sales.sales.loginByPhone\', \'Admin.Admin.login\', \'agent.demand.salesInfo\', \'agent.user.getinfo\', \'agent.user.login\', \'agent.player.login\', \'agent.user.admin_login\', \'agent.user.report_login\', \'agent.user.getPlayer\');');
|
||
|
||
/// 不校验也不生成user_auth_token的接口列表
|
||
define('IGNORE_USER_AUTH_TOKEN_METHOD_LIST', 'return array(\'agent.user.getUserInfo\', \'admin.Admin.createAgent\', \'Admin.Admin.createChannel\', \'Admin.Admin.createGame\', \'agent.gift.newrechargecard\', \'report.report.areaNumberOfPeopleMap\', \'sales.sales.captchaLogin\', \'youle.youle.channelConfigById\', \'agent.user.whiteList\', \'agent.user.changeWhiteList\', \'agent.user.queryShortNum\', \'agent.order.createStarOrder\', \'agent.order.buyStarRecord\', \'Youle.Youle.productList\', \'agent.order.isPay\', \'report.report.exportReport\', \'Youle.Youle.webLog\', \'Youle.Youle.channelConfig\', \'Youle.Youle.gameList\', \'Youle.Youle.channelList\', \'sms.sms.sendBindCode\', \'agent.order.ordersuccess\', \'agent.game.downList\', );');
|
||
|
||
/// ==== ↑ 其他配置 ↑ ====
|
||
}
|
||
|
||
|
||
/**
|
||
* @note 定义用于登录的接口名
|
||
* @return array
|
||
*/
|
||
function LOGIN_METHOD_LIST()
|
||
{
|
||
return eval(LOGIN_METHOD_LIST);
|
||
}
|
||
|
||
/**
|
||
* @note 定义用于内部访问服务器的地址
|
||
* @return array
|
||
*/
|
||
function INTERNAL_WHITELIST()
|
||
{
|
||
return eval(INTERNAL_WHITELIST);
|
||
}
|
||
|
||
/**
|
||
* @note 不校验也不生成user_auth_token的接口列表
|
||
* @return mixed
|
||
*/
|
||
function IGNORE_USER_AUTH_TOKEN_METHOD_LIST()
|
||
{
|
||
return eval(IGNORE_USER_AUTH_TOKEN_METHOD_LIST);
|
||
}
|
||
|
||
|
||
/*
|
||
游戏只读实例
|
||
rr-bp1x2415jy37d8mu1o.mysql.rds.aliyuncs.com
|
||
games
|
||
Games2017@)!&
|
||
*/
|