/** * @brief * @param * @return * @author fanmengzhe * @date 2011/11/08 11:50:24 * @note */ protected function _getServer($strServer, $strMethod) { $arrServConf = Bd_Passport_Conf::getConf('server'); if (isset($arrServConf['cur_idc'])) { $cur_idc = $arrServConf['cur_idc']; } else { Bd_Passport_Log::warning("cur_idc not exists", -1); return false; } if (isset($arrServConf[$strServer])) { $port = $arrServConf[$strServer]['service_port']; $timeout_c = $arrServConf[$strServer]['service_ctimeout']; $timeout_r = $arrServConf[$strServer]['service_rtimeout']; $timeout_w = $arrServConf[$strServer]['service_wtimeout']; } $ip_cnt = count($arrServConf[$strServer][$cur_idc]); $ip_idx = rand() % $ip_cnt; $ip = $arrServConf[$strServer][$cur_idc][$ip_idx]['ip']; $arrRet = array('ip' => $ip, 'port' => $port, 'timeout_c' => $timeout_c, 'timeout_w' => $timeout_w, 'timeout_r' => $timeout_r); foreach ($arrRet as $key => $val) { if (is_null($val)) { Bd_Passport_Log::warning("{$key} not exists", -1); return false; } } return $arrRet; }
protected function __construct() { self::$_appUser = Bd_Passport_Conf::getConf('app_user'); self::$_appPasswd = Bd_Passport_Conf::getConf('app_passwd'); self::$_encoding = Bd_Passport_Conf::getConfEx('internal_encoding', 'utf8'); if (!in_array(self::$_encoding, array('gbk', 'gb18030', 'utf8'))) { self::$_encoding = 'utf8'; } if (is_null(self::$_appUser) || is_null(self::$_appPasswd)) { Bd_Passport_Log::warning("Invalid app_user or app_passwd.", E_USER_ERROR); } if (!defined('LOG_ID')) { define('LOG_ID', Bd_Passport_Util::getLogId()); } if (!defined('CLIENT_IP')) { define('CLIENT_IP', Bd_Passport_Util::getClientIp()); } }
protected function __construct() { self::$_apid = Bd_Passport_Conf::getConf('apid'); self::$_tpl = Bd_Passport_Conf::getConf('tpl'); self::$_pass = Bd_Passport_Conf::getConf('pass'); self::$_is_orp = intval(Bd_Passport_Conf::getConfEx('is_orp', 0)) === 1 ? true : false; if (is_null(self::$_apid)) { Bd_Passport_Log::warning("Apid for session Not Found!", -1); } if (!defined('LOG_ID')) { define('LOG_ID', Bd_Passport_Util::getLogId()); } if (!defined('CLIENT_IP')) { define('CLIENT_IP', Bd_Passport_Util::getClientIp()); } }