original_string: public function filterHttpRequest($method, $url, $headers = array(), $body = null, $contentType = null) {
          if ($this->getAuthSubToken() != null) {
              // AuthSub authentication
              if ($this->getAuthSubPrivateKeyId() != null) {
                  // secure AuthSub
                  $time = time();
                  $nonce = mt_rand(0, 999999999);
                  $dataToSign = $method . ' ' . $url . ' ' . $time . ' ' . $nonce;
  
                  // compute signature
                  $pKeyId = $this->getAuthSubPrivateKeyId();
                  $signSuccess = openssl_sign($dataToSign, $signature, $pKeyId,
                                              OPENSSL_ALGO_SHA1);
                  if (!$signSuccess) {
                      require_once 'Zend/Gdata/App/Exception.php';
                      throw new Zend_Gdata_App_Exception(
                              'openssl_signing failure - returned false');
                  }
                  // encode signature
                  $encodedSignature = base64_encode($signature);
  
                  // final header
                  $headers['authorization'] = 'AuthSub token="' . $this->getAuthSubToken() . '" ' .
                                              'data="' . $dataToSign . '" ' .
                                              'sig="' . $encodedSignature . '" ' .
                                              'sigalg="rsa-sha1"';
              } else {
                  // AuthSub without secure tokens
                  $headers['authorization'] = 'AuthSub token="' . $this->getAuthSubToken() . '"';
              }
          } elseif ($this->getClientLoginToken() != null) {
              $headers['authorization'] = 'GoogleLogin auth=' . $this->getClientLoginToken();
          }
          return array('method' => $method, 'url' => $url, 'body' => $body, 'headers' => $headers, 'contentType' => $contentType);
      }
code: public function filterHttpRequest($method, $url, $headers = array(), $body = null, $contentType = null) {
          if ($this->getAuthSubToken() != null) {
              // AuthSub authentication
              if ($this->getAuthSubPrivateKeyId() != null) {
                  // secure AuthSub
                  $time = time();
                  $nonce = mt_rand(0, 999999999);
                  $dataToSign = $method . ' ' . $url . ' ' . $time . ' ' . $nonce;
  
                  // compute signature
                  $pKeyId = $this->getAuthSubPrivateKeyId();
                  $signSuccess = openssl_sign($dataToSign, $signature, $pKeyId,
                                              OPENSSL_ALGO_SHA1);
                  if (!$signSuccess) {
                      require_once 'Zend/Gdata/App/Exception.php';
                      throw new Zend_Gdata_App_Exception(
                              'openssl_signing failure - returned false');
                  }
                  // encode signature
                  $encodedSignature = base64_encode($signature);
  
                  // final header
                  $headers['authorization'] = 'AuthSub token="' . $this->getAuthSubToken() . '" ' .
                                              'data="' . $dataToSign . '" ' .
                                              'sig="' . $encodedSignature . '" ' .
                                              'sigalg="rsa-sha1"';
              } else {
                  // AuthSub without secure tokens
                  $headers['authorization'] = 'AuthSub token="' . $this->getAuthSubToken() . '"';
              }
          } elseif ($this->getClientLoginToken() != null) {
              $headers['authorization'] = 'GoogleLogin auth=' . $this->getClientLoginToken();
          }
          return array('method' => $method, 'url' => $url, 'body' => $body, 'headers' => $headers, 'contentType' => $contentType);
      }
code_tokens: public function filterHttpRequest ( $ method , $ url , $ headers = array ( ) , $ body = null , $ contentType = null ) { if ( $ this -> getAuthSubToken ( ) != null ) { // AuthSub authentication if ( $ this -> getAuthSubPrivateKeyId ( ) != null ) { // secure AuthSub $ time = time ( ) ; $ nonce = mt_rand ( 0 , 999999999 ) ; $ dataToSign = $ method . ' ' . $ url . ' ' . $ time . ' ' . $ nonce ; // compute signature $ pKeyId = $ this -> getAuthSubPrivateKeyId ( ) ; $ signSuccess = openssl_sign ( $ dataToSign , $ signature , $ pKeyId , OPENSSL_ALGO_SHA1 ) ; if ( ! $ signSuccess ) { require_once 'Zend/Gdata/App/Exception.php' ; throw new Zend_Gdata_App_Exception ( 'openssl_signing failure - returned false' ) ; } // encode signature $ encodedSignature = base64_encode ( $ signature ) ; // final header $ headers [ 'authorization' ] = 'AuthSub token="' . $ this -> getAuthSubToken ( ) . '" ' . 'data="' . $ dataToSign . '" ' . 'sig="' . $ encodedSignature . '" ' . 'sigalg="rsa-sha1"' ; } else { // AuthSub without secure tokens $ headers [ 'authorization' ] = 'AuthSub token="' . $ this -> getAuthSubToken ( ) . '"' ; } } elseif ( $ this -> getClientLoginToken ( ) != null ) { $ headers [ 'authorization' ] = 'GoogleLogin auth=' . $ this -> getClientLoginToken ( ) ; } return array ( 'method' => $ method , 'url' => $ url , 'body' => $ body , 'headers' => $ headers , 'contentType' => $ contentType ) ; }
docstring: Filters the HTTP requests being sent to add the Authorization header.
  
  If both AuthSub and ClientLogin tokens are set,
  AuthSub takes precedence.  If an AuthSub key is set, then
  secure AuthSub authentication is used, and the request is signed.
  Requests must be signed only with the private key corresponding to the
  public key registered with Google.  If an AuthSub key is set, but
  openssl support is not enabled in the PHP installation, an exception is
  thrown.
  
  @param string $method The HTTP method
  @param string $url The URL
  @param array $headers An associate array of headers to be
  sent with the request or null
  @param string $body The body of the request or null
  @param string $contentType The MIME content type of the body or null
  @throws Zend_Gdata_App_Exception if there was a signing failure
  @return array The processed values in an associative array,
  using the same names as the params
docstring_tokens: Filters the HTTP requests being sent to add the Authorization header .