class StatusInfoDrupal6

  1. 8.0.x lib/Drush/UpdateService/StatusInfoDrupal6.php StatusInfoDrupal6
  2. 7.x lib/Drush/UpdateService/StatusInfoDrupal6.php StatusInfoDrupal6

Namespace

Drush\UpdateService

Hierarchy

Expanded class hierarchy of StatusInfoDrupal6

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
StatusInfoDrupal6::afterGetStatus function Perform adjustments after running get status. Overrides StatusInfoDrupal7::afterGetStatus
StatusInfoDrupal6::beforeGetStatus function Perform adjustments before running get status. Overrides StatusInfoDrupal7::beforeGetStatus
StatusInfoDrupal6::getAvailableReleases protected function Obtains release info for all installed projects via update.module. Overrides StatusInfoDrupal7::getAvailableReleases
StatusInfoDrupal7::lastCheck function Returns time of last check of available updates. Overrides StatusInfoDrupal8::lastCheck
StatusInfoDrupal8::calculateUpdateStatus protected function Calculates update status for all projects via update.module.
StatusInfoDrupal8::getStatus function Get update information for all installed projects. Overrides StatusInfoInterface::getStatus
StatusInfoDrupal8::refresh function Refresh update status information. Overrides StatusInfoInterface::refresh
StatusInfoDrupal8::__construct public function Constructor. @todo this pertains to a yet to be defined EngineInterface. Overrides StatusInfoInterface::__construct

File

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

View source
class StatusInfoDrupal6 extends StatusInfoDrupal7 {

  /**
   * {@inheritdoc}
   */
  function beforeGetStatus(&$projects, $check_disabled) {
    // If check-disabled option was provided, alter Drupal settings temporarily.
    // There's no other way to hook into this.
    if (!is_null($check_disabled)) {
      global $conf;
      $this->update_check_disabled = $conf['update_advanced_check_disabled'];
      $conf['update_advanced_check_disabled'] = $check_disabled;
    }
  }

  /**
   * {@inheritdoc}
   */
  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);
        }
      }
    }
  }

  /**
   * Obtains release info for all installed projects via update.module.
   *
   * @see update_get_available().
   * @see update_manual_status().
   */
  protected function getAvailableReleases() {
    // We force a refresh if the cache is not available.
    if (!cache_get('update_available_releases', 'cache_update')) {
      $this->refresh();
    }

    $available = update_get_available(TRUE);

    // Force to invalidate some update_status caches that are only cleared
    // when visiting update status report page.
    if (function_exists('_update_cache_clear')) {
      _update_cache_clear('update_project_data');
      _update_cache_clear('update_project_projects');
    }

    return $available;
  }
}