You are here

protected static function Updater::getExtensionInfo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 142
Contains \Drupal\Core\Updater\Updater.

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(t('Unable to parse info file: %info_file.', [
      '%info_file' => $info_file,
    ]));
  }
  return $info;
}