registerNamespace ( 'Thrift', $path ); $nsLoader->registerNamespace ( 'Osp', $path ); $nsLoader->registerNamespace ( 'vipapis', $path ); $nsLoader->register (); } public static function getService(){ if (! RetransmitServiceClient::$isRegis){ RetransmitServiceClient::regis (); RetransmitServiceClient::$isRegis = true; } $ctx = \Osp\Context\InvocationContextFactory::getInstance (); $ip = RetransmitServiceClient::$DEFAULT_PROXY_IP; $port = RetransmitServiceClient::$DEFAULT_PROXY_PORT; try{ $envCfg = getenv ( "VIP_OSP_PROXY" ); $ipport = explode ( ":", $envCfg ); if (strlen ( $envCfg ) > 0 && count ( $ipport ) == 2){ $ip = $ipport [0]; $port = $ipport [1]; } } catch(\Exception $e){ $ip = RetransmitServiceClient::$DEFAULT_PROXY_IP; $port = RetransmitServiceClient::$DEFAULT_PROXY_PORT; } if ($ctx->getCalleeIP () == null){ $ctx->setCalleeIP ( $ip ); } if ($ctx->getCalleePort () == null){ $ctx->setCalleePort ( $port ); } //$ctx->setProtocol ( \Osp\Protocol\OspProtocol::$Binary ); return new \vipapis\informal\RetransmitServiceHelper(); } } ?>