Skip navigation
Help

drupal_get_filetransfer_info

7 common.inc drupal_get_filetransfer_info()

Drupal FileTransfer registry.

Return value

Returns the Drupal FileTransfer class registry.

See also

FileTransfer

hook_filetransfer_info()

hook_filetransfer_info_alter()

2 calls to drupal_get_filetransfer_info()

File

drupal/includes/common.inc, line 7835
Common functions that many Drupal modules will need to reference.

Code

function drupal_get_filetransfer_info() {
  $info = &drupal_static(__FUNCTION__);
  if (!isset($info)) {
    // Since we have to manually set the 'file path' default for each
    // module separately, we can't use module_invoke_all().
    $info = array();
    foreach (module_implements('filetransfer_info') as $module) {
      $function = $module . '_filetransfer_info';
      if (function_exists($function)) {
        $result = $function();
        if (isset($result) && is_array($result)) {
          foreach ($result as &$values) {
            if (empty($values['file path'])) {
              $values['file path'] = drupal_get_path('module', $module);
            }
          }
          $info = array_merge_recursive($info, $result);
        }
      }
    }
    drupal_alter('filetransfer_info', $info);
    uasort($info, 'drupal_sort_weight');
  }
  return $info;
}