function StatusInfoDrupal6::afterGetStatus

8.0.x StatusInfoDrupal6.php StatusInfoDrupal6::afterGetStatus(&$update_info, $projects, $check_disabled)
7.x StatusInfoDrupal6.php StatusInfoDrupal6::afterGetStatus(&$update_info, $projects, $check_disabled)

Perform adjustments after running get status.

  • Restore check-disabled setting in update module.
  • Adjust project type for disabled projects.

Overrides StatusInfoDrupal7::afterGetStatus

File

lib/Drush/UpdateService/StatusInfoDrupal6.php, line 28
Implementation of 'drupal' update_status engine for Drupal 6.

Namespace

Drush\UpdateService

Class

StatusInfoDrupal6

Code

function afterGetStatus(&$update_info, $projects, $check_disabled) {
  // Restore Drupal settings.
  if (!is_null($check_disabled)) {
    global $conf;
    $conf['update_advanced_check_disabled'] = $this->update_check_disabled;
    unset($this->update_check_disabled);
  }

  // update_advanced.module sets a different project type
  // for disabled projects. Here we normalize it.
  if ($check_disabled) {
    foreach ($update_info as $key => $project) {
      if (in_array($project['project_type'], array('disabled-module', 'disabled-theme'))) {
        $update_info[$key]['project_type'] = substr($project['project_type'], strpos($project['project_type'], '-') + 1);
      }
    }
  }
}