static function SSH::factory

Overrides Drupal\Core\FileTransfer\FileTransfer::factory().

Overrides FileTransfer::factory

File

drupal/core/lib/Drupal/Core/FileTransfer/SSH.php, line 42
Definition of Drupal\Core\FileTransfer\SSH.

Class

SSH
The SSH connection class for the update module.

Namespace

Drupal\Core\FileTransfer

Code

static function factory($jail, $settings) {
  $username = empty($settings['username']) ? '' : $settings['username'];
  $password = empty($settings['password']) ? '' : $settings['password'];
  $hostname = empty($settings['advanced']['hostname']) ? 'localhost' : $settings['advanced']['hostname'];
  $port = empty($settings['advanced']['port']) ? 22 : $settings['advanced']['port'];
  return new SSH($jail, $username, $password, $hostname, $port);
}