You are here

function LingotekOAuthRequest::getSignatureMethod in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::getSignatureMethod()
  2. 7.4 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::getSignatureMethod()
  3. 7.6 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::getSignatureMethod()

* Fetch the signature object used for calculating and checking the signature base string * *

Parameters

string method: * @return LingotekOAuthSignatureMethod object

2 calls to LingotekOAuthRequest::getSignatureMethod()
LingotekOAuthRequest::calculateDataSignature in lib/oauth-php/library/LingotekOAuthRequest.php
* Calculate the signature of a string. * Uses the signature method from the current parameters. * *
LingotekOAuthRequestVerifier::verifyDataSignature in lib/oauth-php/library/LingotekOAuthRequestVerifier.php
* Verify the signature of a string. * *

File

lib/oauth-php/library/LingotekOAuthRequest.php, line 279

Class

LingotekOAuthRequest
Object to parse an incoming OAuth request or prepare an outgoing OAuth request

Code

function getSignatureMethod($method) {
  $m = strtoupper($method);
  $m = preg_replace('/[^A-Z0-9]/', '_', $m);
  $class = 'LingotekOAuthSignatureMethod_' . $m;
  if (file_exists(dirname(__FILE__) . '/signature_method/' . $class . '.php')) {
    require_once dirname(__FILE__) . '/signature_method/' . $class . '.php';
    $sig = new $class();
  }
  else {
    throw new OAuthException2('Unsupported signature method "' . $m . '".');
  }
  return $sig;
}