You are here

protected static function ComposerUtility::getCorePackageList in Automatic Updates 8.2

Returns the canonical names of the supported core packages.

Return value

string[] The canonical list of supported core package names, as listed in ../core_packages.json.

1 call to ComposerUtility::getCorePackageList()
ComposerUtility::getCorePackageNames in package_manager/src/ComposerUtility.php
Returns the names of the core packages required in composer.json.

File

package_manager/src/ComposerUtility.php, line 73

Class

ComposerUtility
Defines a utility object to get information from Composer's API.

Namespace

Drupal\package_manager

Code

protected static function getCorePackageList() : array {
  if (self::$corePackages === NULL) {
    $file = __DIR__ . '/../core_packages.json';
    assert(file_exists($file), "{$file} does not exist.");
    $core_packages = file_get_contents($file);
    $core_packages = Json::decode($core_packages);
    assert(is_array($core_packages), "{$file} did not contain a list of core packages.");
    self::$corePackages = $core_packages;
  }
  return self::$corePackages;
}