You are here

public function UpdateRecommender::getProjectInfo in Automatic Updates 8.2

Returns up-to-date project information for Drupal core.

Parameters

bool $refresh: (optional) Whether to fetch the latest information about available updates from drupal.org. This can be an expensive operation, so defaults to FALSE.

Return value

array The retrieved project information for Drupal core.

Throws

\RuntimeException If data about available updates cannot be retrieved.

1 call to UpdateRecommender::getProjectInfo()
UpdateRecommender::getRecommendedRelease in src/UpdateRecommender.php
Returns the recommended release of Drupal core.

File

src/UpdateRecommender.php, line 27

Class

UpdateRecommender
Determines the recommended release of Drupal core to update to.

Namespace

Drupal\automatic_updates

Code

public function getProjectInfo(bool $refresh = FALSE) : array {
  $available_updates = update_get_available($refresh);
  if (empty($available_updates)) {
    throw new \RuntimeException('There was a problem getting update information. Try again later.');
  }
  $project_data = update_calculate_project_data($available_updates);
  return $project_data['drupal'];
}