function Updater::getExtensionInfo

Same name in other branches
  1. 9 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::getExtensionInfo()
  2. 8.9.x core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::getExtensionInfo()
  3. 10 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 151

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;
}

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