You are here

function system_filetransfer_info in Drupal 8

Same name and namespace in other branches
  1. 7 modules/system/system.module \system_filetransfer_info()
  2. 9 core/modules/system/system.module \system_filetransfer_info()

Implements hook_filetransfer_info().

File

core/modules/system/system.module, line 578
Configuration system that lets administrators modify the workings of the site.

Code

function system_filetransfer_info() {
  $backends = [];

  // This is the default, will be available on most systems.
  if (function_exists('ftp_connect')) {
    $backends['ftp'] = [
      'title' => t('FTP'),
      'class' => 'Drupal\\Core\\FileTransfer\\FTP',
      'weight' => 0,
    ];
  }

  // SSH2 lib connection is only available if the proper PHP extension is
  // installed.
  if (function_exists('ssh2_connect')) {
    $backends['ssh'] = [
      'title' => t('SSH'),
      'class' => 'Drupal\\Core\\FileTransfer\\SSH',
      'weight' => 20,
    ];
  }
  return $backends;
}