3 namespace Drupal\image;
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
10 * Manages image effect plugins.
12 * @see hook_image_effect_info_alter()
13 * @see \Drupal\image\Annotation\ImageEffect
14 * @see \Drupal\image\ConfigurableImageEffectInterface
15 * @see \Drupal\image\ConfigurableImageEffectBase
16 * @see \Drupal\image\ImageEffectInterface
17 * @see \Drupal\image\ImageEffectBase
20 class ImageEffectManager extends DefaultPluginManager {
23 * Constructs a new ImageEffectManager.
25 * @param \Traversable $namespaces
26 * An object that implements \Traversable which contains the root paths
27 * keyed by the corresponding namespace to look for plugin implementations.
28 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
29 * Cache backend instance to use.
30 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
33 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
34 parent::__construct('Plugin/ImageEffect', $namespaces, $module_handler, 'Drupal\image\ImageEffectInterface', 'Drupal\image\Annotation\ImageEffect');
36 $this->alterInfo('image_effect_info');
37 $this->setCacheBackend($cache_backend, 'image_effect_plugins');