function authorize_get_filetransfer

authorize_get_filetransfer($backend, $settings = array())

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.

File

includes/authorize.inc, line 319
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 (!empty($backend_info['file'])) {
      $file = $backend_info['file path'] . '/' . $backend_info['file'];
      require_once $file;
    }
    if (class_exists($backend_info['class'])) {
      // PHP 5.2 doesn't support $class::factory() syntax, so we have to
      // use call_user_func_array() until we can require PHP 5.3.
      $filetransfer = call_user_func_array(array($backend_info['class'], 'factory'), array(DRUPAL_ROOT, $settings));
    }
  }
  return $filetransfer;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!authorize.inc/function/authorize_get_filetransfer/7.x