original_string: protected function makeRequest($url)
      {
          // Verify that we are not in a redirect loop
          $this->_numRequests++;
          if ($this->_numRequests > 4) {
              $message = 'Exceeded the maximum number of redirects (3) in proxied service request.';
              phpCAS::trace($message);
              throw new CAS_ProxiedService_Exception($message);
          }
  
          // Create a new request.
          $request = clone $this->requestHandler;
          $request->setUrl($url);
  
          // Add any cookies to the request.
          $request->addCookies($this->_cookieJar->getCookies($url));
  
          // Add any other parts of the request needed by concrete classes
          $this->populateRequest($request);
  
          // Perform the request.
          phpCAS::trace('Performing proxied service request to \'' . $url . '\'');
          if (!$request->send()) {
              $message = 'Could not perform proxied service request to URL`'
              . $url . '\'. ' . $request->getErrorMessage();
              phpCAS::trace($message);
              throw new CAS_ProxiedService_Exception($message);
          }
  
          // Store any cookies from the response;
          $this->_cookieJar->storeCookies($url, $request->getResponseHeaders());
  
          // Follow any redirects
          if ($redirectUrl = $this->getRedirectUrl($request->getResponseHeaders())
          ) {
              phpCAS::trace('Found redirect:' . $redirectUrl);
              $this->makeRequest($redirectUrl);
          } else {
  
              $this->_responseHeaders = $request->getResponseHeaders();
              $this->_responseBody = $request->getResponseBody();
              $this->_responseStatusCode = $request->getResponseStatusCode();
          }
      }
code: protected function makeRequest($url)
      {
          // Verify that we are not in a redirect loop
          $this->_numRequests++;
          if ($this->_numRequests > 4) {
              $message = 'Exceeded the maximum number of redirects (3) in proxied service request.';
              phpCAS::trace($message);
              throw new CAS_ProxiedService_Exception($message);
          }
  
          // Create a new request.
          $request = clone $this->requestHandler;
          $request->setUrl($url);
  
          // Add any cookies to the request.
          $request->addCookies($this->_cookieJar->getCookies($url));
  
          // Add any other parts of the request needed by concrete classes
          $this->populateRequest($request);
  
          // Perform the request.
          phpCAS::trace('Performing proxied service request to \'' . $url . '\'');
          if (!$request->send()) {
              $message = 'Could not perform proxied service request to URL`'
              . $url . '\'. ' . $request->getErrorMessage();
              phpCAS::trace($message);
              throw new CAS_ProxiedService_Exception($message);
          }
  
          // Store any cookies from the response;
          $this->_cookieJar->storeCookies($url, $request->getResponseHeaders());
  
          // Follow any redirects
          if ($redirectUrl = $this->getRedirectUrl($request->getResponseHeaders())
          ) {
              phpCAS::trace('Found redirect:' . $redirectUrl);
              $this->makeRequest($redirectUrl);
          } else {
  
              $this->_responseHeaders = $request->getResponseHeaders();
              $this->_responseBody = $request->getResponseBody();
              $this->_responseStatusCode = $request->getResponseStatusCode();
          }
      }
code_tokens: protected function makeRequest ( $ url ) { // Verify that we are not in a redirect loop $ this -> _numRequests ++ ; if ( $ this -> _numRequests > 4 ) { $ message = 'Exceeded the maximum number of redirects (3) in proxied service request.' ; phpCAS :: trace ( $ message ) ; throw new CAS_ProxiedService_Exception ( $ message ) ; } // Create a new request. $ request = clone $ this -> requestHandler ; $ request -> setUrl ( $ url ) ; // Add any cookies to the request. $ request -> addCookies ( $ this -> _cookieJar -> getCookies ( $ url ) ) ; // Add any other parts of the request needed by concrete classes $ this -> populateRequest ( $ request ) ; // Perform the request. phpCAS :: trace ( 'Performing proxied service request to \'' . $ url . '\'' ) ; if ( ! $ request -> send ( ) ) { $ message = 'Could not perform proxied service request to URL`' . $ url . '\'. ' . $ request -> getErrorMessage ( ) ; phpCAS :: trace ( $ message ) ; throw new CAS_ProxiedService_Exception ( $ message ) ; } // Store any cookies from the response; $ this -> _cookieJar -> storeCookies ( $ url , $ request -> getResponseHeaders ( ) ) ; // Follow any redirects if ( $ redirectUrl = $ this -> getRedirectUrl ( $ request -> getResponseHeaders ( ) ) ) { phpCAS :: trace ( 'Found redirect:' . $ redirectUrl ) ; $ this -> makeRequest ( $ redirectUrl ) ; } else { $ this -> _responseHeaders = $ request -> getResponseHeaders ( ) ; $ this -> _responseBody = $ request -> getResponseBody ( ) ; $ this -> _responseStatusCode = $ request -> getResponseStatusCode ( ) ; } }
docstring: Build and perform a request, following redirects
  
  @param string $url url for the request
  
  @return void
  @throws CAS_ProxyTicketException If there is a proxy-ticket failure.
  The code of the Exception will be one of:
  PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE
  PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE
  PHPCAS_SERVICE_PT_FAILURE
  @throws CAS_ProxiedService_Exception If there is a failure sending the
  request to the target service.
docstring_tokens: Build and perform a request following redirects