original_string: protected function serverRequest($path, $context)
  	{
  		if (strpos($path, '/') === 0)
  		{
  			$path = substr($path, 1);
  		}
  
  		$url = sprintf('http://%s/%s', $this->serverUrl, $path);
  
  		$context = stream_context_create($context);
  		$result = @file_get_contents($url, false, $context);
  
  		if ($result === false)
  		{
  			throw new ClientException('Failed connecting to ' . $url);
  		}
  
  		if (($result = json_decode($result)) === false)
  		{
  			throw new ClientException("Failed decoding json response from server");
  		}
  
  		if (empty($result))
  		{
  			throw new ClientException("Did not receive a valid client instance");
  		}
  
  		return $result;
  	}
code: protected function serverRequest($path, $context)
  	{
  		if (strpos($path, '/') === 0)
  		{
  			$path = substr($path, 1);
  		}
  
  		$url = sprintf('http://%s/%s', $this->serverUrl, $path);
  
  		$context = stream_context_create($context);
  		$result = @file_get_contents($url, false, $context);
  
  		if ($result === false)
  		{
  			throw new ClientException('Failed connecting to ' . $url);
  		}
  
  		if (($result = json_decode($result)) === false)
  		{
  			throw new ClientException("Failed decoding json response from server");
  		}
  
  		if (empty($result))
  		{
  			throw new ClientException("Did not receive a valid client instance");
  		}
  
  		return $result;
  	}
code_tokens: protected function serverRequest ( $ path , $ context ) { if ( strpos ( $ path , '/' ) === 0 ) { $ path = substr ( $ path , 1 ) ; } $ url = sprintf ( 'http://%s/%s' , $ this -> serverUrl , $ path ) ; $ context = stream_context_create ( $ context ) ; $ result = @ file_get_contents ( $ url , false , $ context ) ; if ( $ result === false ) { throw new ClientException ( 'Failed connecting to ' . $ url ) ; } if ( ( $ result = json_decode ( $ result ) ) === false ) { throw new ClientException ( "Failed decoding json response from server" ) ; } if ( empty ( $ result ) ) { throw new ClientException ( "Did not receive a valid client instance" ) ; } return $ result ; }
docstring: Execute a request against the server
  
  @param   string  $path     the server path
  @param   array  $context  contextual array for stream_context_create
  @return  stdClass the decoded json body
docstring_tokens: Execute a request against the server