Authored by 郝肖肖

分流条件判断

... ... @@ -141,10 +141,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) >= 0) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) >= 0) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -293,10 +293,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) >= 0) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) >= 0) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -731,7 +731,7 @@ class Yohobuy
}
$paseUrl = parse_url($url);
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) >= 0) {
if (empty($ips['api.yoho.cn'])) {
return false;
... ... @@ -745,7 +745,7 @@ class Yohobuy
$url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/';
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) >= 0) {
if (empty($ips['service.yoho.cn'])) {
return false;
... ...