You are here

function Net_URL::getStandardPort in Flickr API 5

Returns the standard port number for a protocol

@author Philippe Jausions <Philippe.Jausions@11abacus.com>

Parameters

string $scheme The protocol to lookup:

Return value

integer Port number or NULL if no scheme matches

3 calls to Net_URL::getStandardPort()
Net_URL::getURL in phpFlickr/PEAR/Net/URL.php
Returns full url
Net_URL::setProtocol in phpFlickr/PEAR/Net/URL.php
Forces the URL to a particular protocol
Net_URL::__construct in phpFlickr/PEAR/Net/URL.php
PHP5 Constructor

File

phpFlickr/PEAR/Net/URL.php, line 382

Class

Net_URL

Code

function getStandardPort($scheme) {
  switch (strtolower($scheme)) {
    case 'http':
      return 80;
    case 'https':
      return 443;
    case 'ftp':
      return 21;
    case 'imap':
      return 143;
    case 'imaps':
      return 993;
    case 'pop3':
      return 110;
    case 'pop3s':
      return 995;
    default:
      return null;
  }
}