function pm_release_recommended

8.0.x updatestatus.pm.inc pm_release_recommended(&$project)
6.x updatestatus.pm.inc pm_release_recommended(&$project)
7.x updatestatus.pm.inc pm_release_recommended(&$project)
3.x updatecode.pm.inc pm_release_recommended(&$project)
4.x updatecode.pm.inc pm_release_recommended(&$project)
5.x updatecode.pm.inc pm_release_recommended(&$project)
master updatestatus.pm.inc pm_release_recommended(&$project)

Set a release to a recommended version (if available), and set as updateable.

2 calls to pm_release_recommended()
pm_update_filter in commands/pm/update_info/drupal.inc
Returns a human readable message based on update status of a project.
pm_update_filter in commands/pm/update_info/drupal_6.inc
Returns a human readable message based on update status of a project.

File

commands/pm/updatestatus.pm.inc, line 192
pm-updatestatus command implementation.

Code

function pm_release_recommended(&$project) {
  if (isset($project['recommended'])) {
    $project['candidate_version'] = $project['recommended'];
    $project['updateable'] = TRUE;
  }
  // If installed version is dev and the candidate version is older, choose
  // latest dev as candidate.
  if (($project['install_type'] == 'dev') && isset($project['candidate_version'])) {
    if ($project['releases'][$project['candidate_version']]['date'] < $project['info']['datestamp']) {
      $project['candidate_version'] = $project['latest_dev'];
      if ($project['releases'][$project['candidate_version']]['date'] <= $project['info']['datestamp']) {
        $project['candidate_version'] = $project['existing_version'];
        $project['updateable'] = FALSE;
      }
    }
  }
}