function SandboxDatabaseUpdatesValidator::getExtensionsWithDatabaseUpdates

Gets extensions that have database updates in the stage directory.

Parameters

string $stage_dir: The path of the stage directory.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup[] The names of the extensions that have database updates.

1 call to SandboxDatabaseUpdatesValidator::getExtensionsWithDatabaseUpdates()
SandboxDatabaseUpdatesValidator::checkForStagedDatabaseUpdates in core/modules/package_manager/src/Validator/SandboxDatabaseUpdatesValidator.php
Checks that the staged update does not have changes to its install files.

File

core/modules/package_manager/src/Validator/SandboxDatabaseUpdatesValidator.php, line 191

Class

SandboxDatabaseUpdatesValidator
Flags a warning if there are database updates in a staged update.

Namespace

Drupal\package_manager\Validator

Code

public function getExtensionsWithDatabaseUpdates(string $stage_dir) : array {
  $extensions_with_updates = [];
  // Check all installed extensions for database updates.
  $lists = [
    $this->moduleList,
    $this->themeList,
  ];
  foreach ($lists as $list) {
    foreach ($list->getAllInstalledInfo() as $name => $info) {
      if ($this->hasStagedUpdates($stage_dir, $list->get($name))) {
        $extensions_with_updates[] = $info['name'];
      }
    }
  }
  return $extensions_with_updates;
}

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