Commit c470296c authored by tufengqi's avatar tufengqi

新增强制设置thrfit版本功能

parent 3ec6d275
......@@ -209,8 +209,9 @@ class TCurlClient extends \Thrift\Transport\TTransport
curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($this->handle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->handle, CURLOPT_MAXREDIRS, 1);
if (defined('SERVICE_FORCE_VERSION_KEY') && !empty($GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX'])) {
$cookie = SERVICE_FORCE_VERSION_KEY . '=' . $GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX'];
if (defined('SERVICE_FORCE_VERSION_KEY') && ( !empty($GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX']) || !empty($GLOBALS['GLOBAL_FORCE_THRIFT_VERSION_VALUE_NO_PTEFIX']))) {
$version = $GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX']?:($GLOBALS['GLOBAL_FORCE_THRIFT_VERSION_VALUE_NO_PTEFIX']?:'');
$cookie = SERVICE_FORCE_VERSION_KEY . '=' . $version;
curl_setopt($this->handle, CURLOPT_COOKIE, $cookie);
}
// God, PHP really has some esoteric ways of doing simple things.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment