abstract class FlysystemPluginBase in Flysystem 7
Base class for plugins.
Hierarchy
- class \Drupal\flysystem\Plugin\FlysystemPluginBase implements FlysystemPluginInterface
Expanded class hierarchy of FlysystemPluginBase
3 files declare their use of FlysystemPluginBase
- Ftp.php in src/
Flysystem/ Ftp.php - Contains \Drupal\flysystem\Flysystem\Ftp.
- Local.php in src/
Flysystem/ Local.php - Contains \Drupal\flysystem\Flysystem\Local.
- Missing.php in src/
Flysystem/ Missing.php - Contains \Drupal\flysystem\Flysystem\Missing.
File
- src/
Plugin/ FlysystemPluginBase.php, line 15 - Contains FlysystemPluginBase.
Namespace
Drupal\flysystem\PluginView source
abstract class FlysystemPluginBase implements FlysystemPluginInterface {
/**
* {@inheritdoc}
*/
public static function create(array $configuration) {
return new static($configuration);
}
/**
* {@inheritdoc}
*/
public function getExternalUrl($uri) {
$path = str_replace('\\', '/', $this
->getTarget($uri));
return url('_flysystem/' . $this
->getScheme($uri) . '/' . $path, array(
'absolute' => TRUE,
));
}
/**
* Returns the target file path of a URI.
*
* @param string $uri
* The URI.
*
* @return string
* The file path of the URI.
*/
protected function getTarget($uri) {
return Util::normalizePath(substr($uri, strpos($uri, '://') + 3));
}
/**
* Returns the scheme from the internal URI.
*
* @param string $uri
* The URI.
*
* @return string
* The scheme.
*/
protected function getScheme($uri) {
return substr($uri, 0, strpos($uri, '://'));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FlysystemPluginBase:: |
public static | function |
Creates a new plugin instance. Overrides FlysystemPluginInterface:: |
1 |
FlysystemPluginBase:: |
public | function |
Returns a web accessible URL for the resource. Overrides FlysystemPluginInterface:: |
2 |
FlysystemPluginBase:: |
protected | function | Returns the scheme from the internal URI. | |
FlysystemPluginBase:: |
protected | function | Returns the target file path of a URI. | |
FlysystemPluginInterface:: |
public | function | Returns the Flysystem adapter | 3 |