static function FileTransfer::factory

Defines a factory method for this class.

Classes that extend this class must override the factory() static method. They should return a new instance of the appropriate FileTransfer subclass.

Parameters

string $jail: The full path where all file operations performed by this object will be restricted to. This prevents the FileTransfer classes from being able to touch other parts of the filesystem.

array $settings: An array of connection settings for the FileTransfer subclass. If the getSettingsForm() method uses any nested settings, the same structure will be assumed here.

Return value

object New instance of the appropriate FileTransfer subclass.

Throws

Drupal\Core\FileTransfer\FileTransferException

4 methods override FileTransfer::factory()
FTP::factory in drupal/core/lib/Drupal/Core/FileTransfer/FTP.php
Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
Local::factory in drupal/core/lib/Drupal/Core/FileTransfer/Local.php
Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
SSH::factory in drupal/core/lib/Drupal/Core/FileTransfer/SSH.php
Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
TestFileTransfer::factory in drupal/core/modules/system/lib/Drupal/system/Tests/FileTransfer/TestFileTransfer.php
Defines a factory method for this class.

File

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

Class

FileTransfer
Defines the base FileTransfer class.

Namespace

Drupal\Core\FileTransfer

Code

static function factory($jail, $settings) {
  throw new FileTransferException('FileTransfer::factory() static method not overridden by FileTransfer subclass.');
}