LanguageNegotiationMethodManager.php 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Drupal\language;
  3. use Drupal\Core\Cache\CacheBackendInterface;
  4. use Drupal\Core\Extension\ModuleHandlerInterface;
  5. use Drupal\Core\Plugin\DefaultPluginManager;
  6. /**
  7. * Manages language negotiation methods.
  8. */
  9. class LanguageNegotiationMethodManager extends DefaultPluginManager {
  10. /**
  11. * Constructs a new LanguageNegotiationMethodManager object.
  12. *
  13. * @param \Traversable $namespaces
  14. * An object that implements \Traversable which contains the root paths
  15. * keyed by the corresponding namespace to look for plugin implementations.
  16. * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  17. * An object that implements CacheBackendInterface
  18. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  19. * An object that implements ModuleHandlerInterface
  20. */
  21. public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  22. parent::__construct('Plugin/LanguageNegotiation', $namespaces, $module_handler, 'Drupal\language\LanguageNegotiationMethodInterface', 'Drupal\language\Annotation\LanguageNegotiation');
  23. $this->cacheBackend = $cache_backend;
  24. $this->cacheKeyPrefix = 'language_negotiation_plugins';
  25. $this->cacheKey = 'language_negotiation_plugins';
  26. $this->alterInfo('language_negotiation_info');
  27. }
  28. }