ImageEffectManager.php 1.4 KB

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