original_string: private function _readURL($url, &$headers, &$body, &$err_msg)
      {
          phpCAS::traceBegin();
          $className = $this->_requestImplementation;
          $request = new $className();
  
          if (count($this->_curl_options)) {
              $request->setCurlOptions($this->_curl_options);
          }
  
          $request->setUrl($url);
  
          if (empty($this->_cas_server_ca_cert) && !$this->_no_cas_server_validation) {
              phpCAS::error(
                  'one of the methods phpCAS::setCasServerCACert() or phpCAS::setNoCasServerValidation() must be called.'
              );
          }
          if ($this->_cas_server_ca_cert != '') {
              $request->setSslCaCert(
                  $this->_cas_server_ca_cert, $this->_cas_server_cn_validate
              );
          }
  
          // add extra stuff if SAML
          if ($this->getServerVersion() == SAML_VERSION_1_1) {
              $request->addHeader("soapaction: http://www.oasis-open.org/committees/security");
              $request->addHeader("cache-control: no-cache");
              $request->addHeader("pragma: no-cache");
              $request->addHeader("accept: text/xml");
              $request->addHeader("connection: keep-alive");
              $request->addHeader("content-type: text/xml");
              $request->makePost();
              $request->setPostBody($this->_buildSAMLPayload());
          }
  
          if ($request->send()) {
              $headers = $request->getResponseHeaders();
              $body = $request->getResponseBody();
              $err_msg = '';
              phpCAS::traceEnd(true);
              return true;
          } else {
              $headers = '';
              $body = '';
              $err_msg = $request->getErrorMessage();
              phpCAS::traceEnd(false);
              return false;
          }
      }
code: private function _readURL($url, &$headers, &$body, &$err_msg)
      {
          phpCAS::traceBegin();
          $className = $this->_requestImplementation;
          $request = new $className();
  
          if (count($this->_curl_options)) {
              $request->setCurlOptions($this->_curl_options);
          }
  
          $request->setUrl($url);
  
          if (empty($this->_cas_server_ca_cert) && !$this->_no_cas_server_validation) {
              phpCAS::error(
                  'one of the methods phpCAS::setCasServerCACert() or phpCAS::setNoCasServerValidation() must be called.'
              );
          }
          if ($this->_cas_server_ca_cert != '') {
              $request->setSslCaCert(
                  $this->_cas_server_ca_cert, $this->_cas_server_cn_validate
              );
          }
  
          // add extra stuff if SAML
          if ($this->getServerVersion() == SAML_VERSION_1_1) {
              $request->addHeader("soapaction: http://www.oasis-open.org/committees/security");
              $request->addHeader("cache-control: no-cache");
              $request->addHeader("pragma: no-cache");
              $request->addHeader("accept: text/xml");
              $request->addHeader("connection: keep-alive");
              $request->addHeader("content-type: text/xml");
              $request->makePost();
              $request->setPostBody($this->_buildSAMLPayload());
          }
  
          if ($request->send()) {
              $headers = $request->getResponseHeaders();
              $body = $request->getResponseBody();
              $err_msg = '';
              phpCAS::traceEnd(true);
              return true;
          } else {
              $headers = '';
              $body = '';
              $err_msg = $request->getErrorMessage();
              phpCAS::traceEnd(false);
              return false;
          }
      }
code_tokens: private function _readURL ( $ url , & $ headers , & $ body , & $ err_msg ) { phpCAS :: traceBegin ( ) ; $ className = $ this -> _requestImplementation ; $ request = new $ className ( ) ; if ( count ( $ this -> _curl_options ) ) { $ request -> setCurlOptions ( $ this -> _curl_options ) ; } $ request -> setUrl ( $ url ) ; if ( empty ( $ this -> _cas_server_ca_cert ) && ! $ this -> _no_cas_server_validation ) { phpCAS :: error ( 'one of the methods phpCAS::setCasServerCACert() or phpCAS::setNoCasServerValidation() must be called.' ) ; } if ( $ this -> _cas_server_ca_cert != '' ) { $ request -> setSslCaCert ( $ this -> _cas_server_ca_cert , $ this -> _cas_server_cn_validate ) ; } // add extra stuff if SAML if ( $ this -> getServerVersion ( ) == SAML_VERSION_1_1 ) { $ request -> addHeader ( "soapaction: http://www.oasis-open.org/committees/security" ) ; $ request -> addHeader ( "cache-control: no-cache" ) ; $ request -> addHeader ( "pragma: no-cache" ) ; $ request -> addHeader ( "accept: text/xml" ) ; $ request -> addHeader ( "connection: keep-alive" ) ; $ request -> addHeader ( "content-type: text/xml" ) ; $ request -> makePost ( ) ; $ request -> setPostBody ( $ this -> _buildSAMLPayload ( ) ) ; } if ( $ request -> send ( ) ) { $ headers = $ request -> getResponseHeaders ( ) ; $ body = $ request -> getResponseBody ( ) ; $ err_msg = '' ; phpCAS :: traceEnd ( true ) ; return true ; } else { $ headers = '' ; $ body = '' ; $ err_msg = $ request -> getErrorMessage ( ) ; phpCAS :: traceEnd ( false ) ; return false ; } }
docstring: This method is used to acces a remote URL.
  
  @param string $url      the URL to access.
  @param string &$headers an array containing the HTTP header lines of the
  response (an empty array on failure).
  @param string &$body    the body of the response, as a string (empty on
  failure).
  @param string &$err_msg an error message, filled on failure.
  
  @return true on success, false otherwise (in this later case, $err_msg
  contains an error message).
docstring_tokens: This method is used to acces a remote URL .