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.

1 call to pm_release_recommended()
drush_pm_updatestatus in commands/pm/updatestatus.pm.inc
Command callback. Displays update status info of installed projects.

File

commands/pm/updatestatus.pm.inc, line 229
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['datestamp']) {
      $project['candidate_version'] = $project['latest_dev'];
      if ($project['releases'][$project['candidate_version']]['date'] <= $project['datestamp']) {
        $project['candidate_version'] = $project['existing_version'];
        $project['updateable'] = FALSE;
      }
    }
  }
}