ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\Plugin Namespace Reference

Data Structures

class  AbstractPlugin
 
class  EmptyDir
 
class  ForcedCopy
 
class  ForcedRename
 
class  GetWithMetadata
 
class  ListFiles
 
class  ListPaths
 
class  ListWith
 
class  PluginNotFoundException
 

Functions

 addPlugin (PluginInterface $plugin)
 Register a plugin. More...
 
 findPlugin ($method)
 Find a specific plugin. More...
 
 invokePlugin ($method, array $arguments, FilesystemInterface $filesystem)
 Invoke a plugin by method name. More...
 
 __call ($method, array $arguments)
 Plugins pass-through. More...
 

Variables

trait PluggableTrait
 

Function Documentation

◆ __call()

League\Flysystem\Plugin\__call (   $method,
array  $arguments 
)

Plugins pass-through.

Parameters
string$method
array$arguments
Exceptions
BadMethodCallException
Returns
mixed

Definition at line 85 of file PluggableTrait.php.

References League\Flysystem\Plugin\invokePlugin().

86  {
87  try {
88  return $this->invokePlugin($method, $arguments, $this);
89  } catch (PluginNotFoundException $e) {
90  throw new BadMethodCallException(
91  'Call to undefined method '
92  . get_class($this)
93  . '::' . $method
94  );
95  }
96  }
invokePlugin($method, array $arguments, FilesystemInterface $filesystem)
Invoke a plugin by method name.
+ Here is the call graph for this function:

◆ addPlugin()

League\Flysystem\Plugin\addPlugin ( PluginInterface  $plugin)

Register a plugin.

Parameters
PluginInterface$plugin
Exceptions
LogicException
Returns
$this

Definition at line 26 of file PluggableTrait.php.

References League\Flysystem\PluginInterface\getMethod().

Referenced by ilTinyMCE\addInternalTinyMCEImageManager(), and ilTinyMCE\addPlugin().

27  {
28  if ( ! method_exists($plugin, 'handle')) {
29  throw new LogicException(get_class($plugin) . ' does not have a handle method.');
30  }
31 
32  $this->plugins[$plugin->getMethod()] = $plugin;
33 
34  return $this;
35  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findPlugin()

League\Flysystem\Plugin\findPlugin (   $method)
protected

Find a specific plugin.

Parameters
string$method
Exceptions
PluginNotFoundException
Returns
PluginInterface

Definition at line 46 of file PluggableTrait.php.

Referenced by League\Flysystem\Plugin\invokePlugin().

47  {
48  if ( ! isset($this->plugins[$method])) {
49  throw new PluginNotFoundException('Plugin not found for method: ' . $method);
50  }
51 
52  return $this->plugins[$method];
53  }
+ Here is the caller graph for this function:

◆ invokePlugin()

League\Flysystem\Plugin\invokePlugin (   $method,
array  $arguments,
FilesystemInterface  $filesystem 
)
protected

Invoke a plugin by method name.

Parameters
string$method
array$arguments
FilesystemInterface$filesystem
Exceptions
PluginNotFoundException
Returns
mixed

Definition at line 66 of file PluggableTrait.php.

References League\Flysystem\Plugin\findPlugin().

Referenced by League\Flysystem\Plugin\__call(), and League\Flysystem\MountManager\invokePluginOnFilesystem().

67  {
68  $plugin = $this->findPlugin($method);
69  $plugin->setFilesystem($filesystem);
70  $callback = [$plugin, 'handle'];
71 
72  return call_user_func_array($callback, $arguments);
73  }
findPlugin($method)
Find a specific plugin.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ PluggableTrait

trait League::Flysystem::Plugin\PluggableTrait
Initial value:
{
protected $plugins = []

Definition at line 11 of file PluggableTrait.php.