public function Ftp::getAdapter in Flysystem 3.0.x
Same name and namespace in other branches
- 8 src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
- 7 src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
- 3.x src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
- 2.0.x src/Flysystem/Ftp.php \Drupal\flysystem\Flysystem\Ftp::getAdapter()
Returns the Flysystem adapter.
Plugins should not keep references to the adapter. If a plugin needs to perform filesystem operations, it should either use a scheme:// or have the \Drupal\flysystem\FlysystemFactory injected.
Return value
\League\Flysystem\AdapterInterface The Flysytem adapter.
Overrides FlysystemPluginInterface::getAdapter
1 call to Ftp::getAdapter()
- Ftp::ensure in src/
Flysystem/ Ftp.php - Checks the sanity of the filesystem.
File
- src/
Flysystem/ Ftp.php, line 47
Class
- Ftp
- Drupal plugin for the "FTP" Flysystem adapter.
Namespace
Drupal\flysystem\FlysystemCode
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;
}