You are here

public function UpdateChecklist::getUpdateVersions in Update helper 2.x

Same name and namespace in other branches
  1. 8 modules/update_helper_checklist/src/UpdateChecklist.php \Drupal\update_helper_checklist\UpdateChecklist::getUpdateVersions()

Get update version from update checklist file.

Parameters

string $module: Module name.

Return value

array Returns update versions from update checklist file.

File

modules/update_helper_checklist/src/UpdateChecklist.php, line 268

Class

UpdateChecklist
Update checklist service.

Namespace

Drupal\update_helper_checklist

Code

public function getUpdateVersions($module) {
  $module_directories = $this->moduleHandler
    ->getModuleDirectories();
  if (empty($module_directories[$module])) {
    return [];
  }
  $updates_file = $module_directories[$module] . DIRECTORY_SEPARATOR . static::$updateChecklistFileName;
  if (!is_file($updates_file)) {
    return [];
  }
  $updates_checklist = Yaml::parse(file_get_contents($updates_file));
  return array_keys($updates_checklist);
}