function UpdateRegistry::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::__construct()
  2. 10 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::__construct()
  3. 9 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::__construct()
  4. 8.9.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::__construct()

File

core/lib/Drupal/Core/Update/UpdateRegistry.php, line 54

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function __construct(protected $root, protected $sitePath, array $module_list, protected KeyValueStoreInterface $keyValue, ThemeHandlerInterface $theme_handler, MemoryCacheInterface|string|null $memoryCache = NULL, protected string $updateType = 'post_update') {
  if (is_string($memoryCache)) {
    $updateType = $memoryCache;
    $memoryCache = NULL;
  }
  if (!isset($memoryCache)) {
    $memoryCache = \Drupal::service('cache.memory');
    @trigger_error('Calling ' . __METHOD__ . '() without the $memoryCache argument is deprecated in drupal:11.5.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3618917', E_USER_DEPRECATED);
  }
  $this->updateType = $updateType;
  $this->memoryCache = $memoryCache;
  $this->enabledExtensions = array_merge(array_keys($module_list), array_keys($theme_handler->listInfo()));
}

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