public static function getAddress($ip = null) { $ip = $ip ?: STATIC::getIp(); $ipadd = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=" . $ip); //根据>新浪api接口获取 if ($ipadd) { $charset = iconv("gbk", "utf-8", $ipadd); preg_match_all("/[\\x{4e00}-\\x{9fa5}]+/u", $charset, $ipadds); return $ipadds[0]; } else { return null; } }
/** * Set the posted api related values to the old (from DB) values */ public static function _keepOldApiValues() { $options = STATIC::_setSiteOptions(); $_POST['gigya_global_settings']['api_key'] = $options['api_key']; $_POST['gigya_global_settings']['api_secret'] = $options['api_secret']; $_POST['gigya_global_settings']['data_center'] = $options['data_center']; }