You are here

protected function OAuthRequest::defaultPortForScheme in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.3 lib/oauth-php/library/OAuthRequest.php \OAuthRequest::defaultPortForScheme()

* Return the default port for a scheme * *

Parameters

string scheme: * @return int

2 calls to OAuthRequest::defaultPortForScheme()
OAuthRequest::getRequestUrl in lib/oauth-php/library/OAuthRequest.php
* Return the normalised url for signature checks
OAuthRequest::parseUri in lib/oauth-php/library/OAuthRequest.php
* Parse the uri into its parts. Fill in the missing parts. * *

File

lib/oauth-php/library/OAuthRequest.php, line 592

Class

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

Code

protected function defaultPortForScheme($scheme) {
  switch ($scheme) {
    case 'http':
      return 80;
    case 'https':
      return 443;
    default:
      throw new OAuthException2('Unsupported scheme type, expected http or https, got "' . $scheme . '"');
      break;
  }
}