You are here

class PendingDbUpdates in Automatic Updates 7

Pending database updates checker.

Hierarchy

Expanded class hierarchy of PendingDbUpdates

1 string reference to 'PendingDbUpdates'
ReadinessCheckerManager::getCheckers in ReadinessCheckers/ReadinessCheckerManager.php
Get checkers.

File

ReadinessCheckers/PendingDbUpdates.php, line 6

View source
class PendingDbUpdates implements ReadinessCheckerInterface {

  /**
   * {@inheritdoc}
   */
  public static function run() {
    $messages = [];
    if (static::areDbUpdatesPending()) {
      $messages[] = t('There are pending database updates. Please run update.php.');
    }
    return $messages;
  }

  /**
   * Checks if there are pending database updates.
   *
   * @return bool
   *   TRUE if there are pending updates, otherwise FALSE.
   */
  protected static function areDbUpdatesPending() {
    require_once DRUPAL_ROOT . '/includes/install.inc';
    require_once DRUPAL_ROOT . '/includes/update.inc';
    drupal_load_updates();
    return (bool) update_get_update_list();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PendingDbUpdates::areDbUpdatesPending protected static function Checks if there are pending database updates.
PendingDbUpdates::run public static function Run check. Overrides ReadinessCheckerInterface::run