function pm_project_filter

8.0.x updatestatus.pm.inc pm_project_filter($update_info, $security_only)
6.x updatestatus.pm.inc pm_project_filter($update_info, $security_only)
7.x updatestatus.pm.inc pm_project_filter($update_info, $security_only)
3.x updatecode.pm.inc pm_project_filter(&$projects, &$rows)
4.x updatecode.pm.inc pm_project_filter(&$update_info, &$rows, $security_only)
5.x updatecode.pm.inc pm_project_filter(&$update_info, &$rows, $security_only)
master updatestatus.pm.inc pm_project_filter($update_info, $security_only)

Filter projects based on verbosity level and $security_only flag.

Parameters

array $update_info: Update info for projects.

bool $security_only: Whether to select only projects with security updates.

Return value

Array of projects matching filter criteria.

1 call to pm_project_filter()
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 208
pm-updatestatus command implementation.

Code

function pm_project_filter($update_info, $security_only) {
  $eligible = array();
  foreach ($update_info as $key => $project) {
    if ($security_only) {
      if ($project['status'] == DRUSH_UPDATESTATUS_NOT_SECURE) {
        $eligible[$key] = $project;
      }
    }
    elseif (drush_get_context('DRUSH_VERBOSE')) {
      $eligible[$key] = $project;
    }
    elseif ($project['status'] != DRUSH_UPDATESTATUS_CURRENT) {
      $eligible[$key] = $project;
    }
  }
  return $eligible;
}