You are here

public function UpdateManager::getAvailable in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getAvailable()
  2. 8.2 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getAvailable()
  3. 8.3 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getAvailable()
  4. 8.4 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getAvailable()

Returns all available update definitions.

Return value

array[] The available update definitions.

1 call to UpdateManager::getAvailable()
UpdateManager::executeAllInConsole in src/UpdateManager.php
Executes all available updates in a console context.

File

src/UpdateManager.php, line 153

Class

UpdateManager

Namespace

Drupal\lightning_core

Code

public function getAvailable() {
  $versions = $this->configFactory
    ->getEditable(static::CONFIG_NAME);
  $filter = function (array $definition) use ($versions) {
    $provider_version = $versions
      ->get($definition['provider']) ?: static::VERSION_UNKNOWN;
    return version_compare($definition['id'], $provider_version, '>');
  };
  return array_filter($this
    ->getDefinitions(), $filter);
}