public function UpdateManager::getVersion in Lightning Core 8
Same name and namespace in other branches
- 8.5 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
- 8.2 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
- 8.3 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
- 8.4 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
Tries to determine the semantic version of a module.
Parameters
string $module: The machine name of the module.
Return value
string The semantic version of the module, or static::VERSION_UNKNOWN if it could not be determined.
File
- src/
UpdateManager.php, line 89
Class
Namespace
Drupal\lightning_coreCode
public function getVersion($module) {
$info = system_get_info('module', $module);
if (isset($info['version'])) {
return static::toSemanticVersion($info['version']);
}
else {
// Follow core's model and try to determine the target version of the
// most recent update.
$updates = $this
->getDefinitions($module);
return $updates ? end($updates)['id'] : static::VERSION_UNKNOWN;
}
}