You are here

public function Local::getAdapter in Flysystem 3.x

Same name and namespace in other branches
  1. 8 src/Flysystem/Local.php \Drupal\flysystem\Flysystem\Local::getAdapter()
  2. 7 src/Flysystem/Local.php \Drupal\flysystem\Flysystem\Local::getAdapter()
  3. 2.0.x src/Flysystem/Local.php \Drupal\flysystem\Flysystem\Local::getAdapter()
  4. 3.0.x src/Flysystem/Local.php \Drupal\flysystem\Flysystem\Local::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

File

src/Flysystem/Local.php, line 86

Class

Local
Drupal plugin for the "Local" Flysystem adapter.

Namespace

Drupal\flysystem\Flysystem

Code

public function getAdapter() {
  return $this->rootExists ? new LocalAdapter($this->root) : new MissingAdapter();
}