You are here

function _shorten_method_default in Shorten URLs 8

Same name and namespace in other branches
  1. 8.2 shorten.module \_shorten_method_default()
  2. 6 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.

1 call to _shorten_method_default()
_shorten_service_form in ./shorten.module
Form which displays a list of URL shortening services.

File

./shorten.module, line 467
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';
}