public function UpdateManager::getVersion in Lightning Core 8.3
Same name and namespace in other branches
- 8.5 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
- 8 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getVersion()
- 8.2 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 100
Class
Namespace
Drupal\lightning_coreCode
public function getVersion($module) {
$info = $this->moduleExtensionList
->getAllAvailableInfo();
if (isset($info[$module]['version'])) {
return static::toSemanticVersion($info[$module]['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;
}
}