public function UpdateChecklist::getUpdateVersions in Update helper 8
Same name and namespace in other branches
- 2.x 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_checklistCode
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);
}