You are here

function _shorten_method_default in Shorten URLs 6

Same name and namespace in other branches
  1. 8.2 shorten.module \_shorten_method_default()
  2. 8 shorten.module \_shorten_method_default()
  3. 7.2 shorten.module \_shorten_method_default()
  4. 7 shorten.module \_shorten_method_default()

Determines the default method for retrieving shortened URLs. cURL is the preferred method, but sometimes it's not installed.

4 calls to _shorten_method_default()
shorten_admin in ./shorten.admin.inc
Settings page.
shorten_fetch in ./shorten.module
Downloads the response of the URL abbreviation service.
_shorten_get_url in ./shorten.module
Shortens URLs. Times out after three (3) seconds.
_shorten_service_form in ./shorten.module
Form which displays a list of URL shortening services.

File

./shorten.module, line 603
Shortens URLs via external services.

Code

function _shorten_method_default() {
  if (function_exists('curl_exec')) {
    return 'curl';
  }
  elseif (function_exists('file_get_contents')) {
    return 'php';
  }
  return 'none';
}