Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

Drupal\Core\Plugin\DefaultPluginManager has been added to unify and simplify plugin managers.

The default plugin manager inlines caching (which allows for more performant caching), altering, processing and defaults to use the ContainerFactory. Additionally, the necessary dependencies are injected.

Service definition.

  plugin.manager.archiver:
    class: Drupal\Core\Archiver\ArchiverManager
    parent: default_plugin_manager

<?php
/**
* Archiver plugin manager.
*/
class ArchiverManager extends DefaultPluginManager {
 
/**
   * Constructs a ArchiverManager object.
   *
   * @param \Traversable $namespaces
   *   An object that implements \Traversable which contains the root paths
   *   keyed by the corresponding namespace to look for plugin implementations.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
   *   Cache backend instance to use.
   * @param \Drupal\Core\Language\LanguageManager $language_manager
   *   The language manager.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler to invoke the alter hook with.
   */
 
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) {
   
parent::__construct('Plugin/Archiver', $namespaces, $module_handler, 'Drupal\Core\Archiver\Annotation\Archiver');
   
$this->alterInfo('archiver_info');
   
$this->setCacheBackend($cache_backend, $language_manager, 'archiver_info_plugins');
  }
}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done