Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SystemHooks.php

function SystemHooks::filetransferInfo

Implements hook_filetransfer_info().

File

core/modules/system/src/Hook/SystemHooks.php, line 182

Class

SystemHooks
Hook implementations for system.

Namespace

Drupal\system\Hook

Code

public function filetransferInfo() {
    $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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal