function UpdateManager::__construct

Same name in other branches
  1. 9 core/modules/update/src/UpdateManager.php \Drupal\update\UpdateManager::__construct()
  2. 10 core/modules/update/src/UpdateManager.php \Drupal\update\UpdateManager::__construct()
  3. 11.x core/modules/update/src/UpdateManager.php \Drupal\update\UpdateManager::__construct()

Constructs a UpdateManager.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The Module Handler service

\Drupal\update\UpdateProcessorInterface $update_processor: The Update Processor service.

\Drupal\Core\StringTranslation\TranslationInterface $translation: The translation service.

\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_expirable_factory: The expirable key/value factory.

\Drupal\Core\Extension\ThemeHandlerInterface $theme_handler: The theme handler.

\Drupal\Core\Extension\ModuleExtensionList|null $extension_list_module: The module extension list. This is left optional for BC reasons, but the optional usage is deprecated and will become required in Drupal 9.0.0.

File

core/modules/update/src/UpdateManager.php, line 97

Class

UpdateManager
Default implementation of UpdateManagerInterface.

Namespace

Drupal\update

Code

public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory, ThemeHandlerInterface $theme_handler, ModuleExtensionList $extension_list_module = NULL) {
    $this->updateSettings = $config_factory->get('update.settings');
    $this->moduleHandler = $module_handler;
    $this->updateProcessor = $update_processor;
    $this->stringTranslation = $translation;
    $this->keyValueStore = $key_value_expirable_factory->get('update');
    $this->themeHandler = $theme_handler;
    $this->availableReleasesTempStore = $key_value_expirable_factory->get('update_available_releases');
    $this->projects = [];
    if ($extension_list_module === NULL) {
        @trigger_error('Invoking the UpdateManager constructor without the module extension list parameter is deprecated in Drupal 8.8.0 and will no longer be supported in Drupal 9.0.0. The extension list parameter is now required in the ConfigImporter constructor. See https://www.drupal.org/node/2943918', E_USER_DEPRECATED);
        $extension_list_module = \Drupal::service('extension.list.module');
    }
    $this->moduleExtensionList = $extension_list_module;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.