You are here

public function FlysystemFactory::getPlugin in Flysystem 8

Same name and namespace in other branches
  1. 7 src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::getPlugin()
  2. 3.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::getPlugin()
  3. 2.0.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::getPlugin()
  4. 3.0.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::getPlugin()

Returns the plugin for a scheme.

Parameters

string $scheme: The scheme.

Return value

\Drupal\flysystem\Plugin\FlysystemPluginInterface The plugin.

File

src/FlysystemFactory.php, line 135

Class

FlysystemFactory
A factory for Flysystem filesystems.

Namespace

Drupal\flysystem

Code

public function getPlugin($scheme) {
  if (!isset($this->plugins[$scheme])) {
    $settings = $this
      ->getSettings($scheme);
    $this->plugins[$scheme] = $this->pluginManager
      ->createInstance($settings['driver'], $settings['config']);
  }
  return $this->plugins[$scheme];
}