You are here

public function Ftp::getAdapter in Flysystem 7

Same name and namespace in other branches
  1. 8 src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
  2. 3.x src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
  3. 2.0.x src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
  4. 3.0.x src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()

Returns the Flysystem adapter

Return value

\League\Flysystem\AdapterInterface The Flsysytem adapter.

Overrides FlysystemPluginInterface::getAdapter

1 call to Ftp::getAdapter()
Ftp::ensure in src/Flysystem/Ftp.php

File

src/Flysystem/Ftp.php, line 43
Contains \Drupal\flysystem\Flysystem\Ftp.

Class

Ftp
Drupal plugin for the "FTP" Flysystem adapter.

Namespace

Drupal\flysystem\Flysystem

Code

public function getAdapter() {
  try {
    $adapter = new FtpAdapter($this->configuration);
    $adapter
      ->connect();
  } catch (\RuntimeException $e) {

    // A problem connecting to the server.
    $adapter = new MissingAdapter();
  }
  return $adapter;
}