You are here

function acquia_agent_update_status_alter in Acquia Connector 7

Same name and namespace in other branches
  1. 6.2 acquia_agent/acquia_agent.module \acquia_agent_update_status_alter()
  2. 6 acquia_agent/acquia_agent.module \acquia_agent_update_status_alter()
  3. 7.3 acquia_agent/acquia_agent.module \acquia_agent_update_status_alter()
  4. 7.2 acquia_agent/acquia_agent.module \acquia_agent_update_status_alter()

Implementation of hook_update_status_alter().

This compares the array of computed information about projects that are missing available updates with the saved settings. If the settings specify that a particular project or release should be ignored, the status for that project is altered to indicate it is ignored because of settings.

Parameters

$projects: Reference to an array of information about available updates to each project installed on the system.

See also

update_calculate_project_data()

File

acquia_agent/acquia_agent.module, line 183
Acquia Agent securely sends information to Acquia Network.

Code

function acquia_agent_update_status_alter(&$projects) {
  if (!($subscription = acquia_agent_has_update_service())) {

    // Get subscription data or return if the service is not enabled.
    return;
  }
  foreach ($projects as $project => $project_info) {
    if ($project == 'drupal') {
      if (isset($subscription['update'])) {
        $projects[$project]['status'] = $subscription['update']['status'];
        $projects[$project]['releases'] = $subscription['update']['releases'];
        $projects[$project]['recommended'] = $subscription['update']['recommended'];
        $projects[$project]['latest_version'] = $subscription['update']['latest_version'];

        // Security updates are a separate piece of data.  If we leave it, then core
        // security warnings from druapl.org will also be displayed on the update page.
        unset($projects[$project]['security updates']);
      }
      else {
        $projects[$project]['status'] = UPDATE_NOT_CHECKED;
        $projects[$project]['reason'] = t('No information available from the Acquia Network');
        unset($projects[$project]['releases']);
        unset($projects[$project]['recommended']);
      }
      $projects[$project]['link'] = 'http://acquia.com/products-services/acquia-drupal';
      $projects[$project]['title'] = 'Acquia Drupal';
      $projects[$project]['existing_version'] = ACQUIA_DRUPAL_VERSION;
      $projects[$project]['install_type'] = 'official';
      unset($projects[$project]['extra']);
    }
    elseif ($project_info['datestamp'] == 'acquia drupal') {
      $projects['drupal']['includes'][$project] = $project_info['title'];
      unset($projects[$project]);
    }
  }
}