You are here

protected static function Updater::getExtensionInfo in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::getExtensionInfo()

Get Extension information from directory.

Parameters

string $directory: Directory to search in.

Return value

array Extension info.

Throws

\Drupal\Core\Updater\UpdaterException If the info parser does not provide any info.

2 calls to Updater::getExtensionInfo()
Module::canUpdateDirectory in core/lib/Drupal/Core/Updater/Module.php
Determines if the Updater can handle the project provided in $directory.
Theme::canUpdateDirectory in core/lib/Drupal/Core/Updater/Theme.php
Determines if the Updater can handle the project provided in $directory.

File

core/lib/Drupal/Core/Updater/Updater.php, line 141

Class

Updater
Defines the base class for Updaters used in Drupal.

Namespace

Drupal\Core\Updater

Code

protected static function getExtensionInfo($directory) {
  $info_file = static::findInfoFile($directory);
  $info = \Drupal::service('info_parser')
    ->parse($info_file);
  if (empty($info)) {
    throw new UpdaterException("Unable to parse info file: '{$info_file}'.");
  }
  return $info;
}