function authorize_get_filetransfer

Gets a FileTransfer class for a specific transfer method and settings.

Parameters

$backend: The FileTransfer backend to get the class for.

$settings: Array of settings for the FileTransfer.

Return value

An instantiated FileTransfer object for the requested method and settings, or FALSE if there was an error finding or instantiating it.

3 calls to authorize_get_filetransfer()
authorize_filetransfer_form_submit in drupal/core/includes/authorize.inc
Form submission handler for authorize_filetransfer_form().
authorize_filetransfer_form_validate in drupal/core/includes/authorize.inc
Form validation handler for authorize_filetransfer_form().
_authorize_filetransfer_connection_settings in drupal/core/includes/authorize.inc
Generates the Form API array for a given connection backend's settings.

File

drupal/core/includes/authorize.inc, line 315
Helper functions and form handlers used for the authorize.php script.

Code

function authorize_get_filetransfer($backend, $settings = array()) {
  $filetransfer = FALSE;
  if (!empty($_SESSION['authorize_filetransfer_info'][$backend])) {
    $backend_info = $_SESSION['authorize_filetransfer_info'][$backend];
    if (class_exists($backend_info['class'])) {
      $filetransfer = $backend_info['class']::factory(DRUPAL_ROOT, $settings);
    }
  }
  return $filetransfer;
}