Commit 77939597 authored by heddn's avatar heddn Committed by heddn
Browse files

Issue #3063134 by heddn, tatarbj: Backport PendingDbUpdates

parent dce1e81f
<?php
/**
* Pending database updates checker.
*/
class PendingDbUpdates implements ReadinessCheckerInterface {
/**
* {@inheritdoc}
*/
public static function run() {
$messages = [];
if (static::areDbUpdatesPending()) {
$messages[] = t('There are pending database updates, therefore updates cannot be applied. 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();
}
}
......@@ -28,6 +28,7 @@ class ReadinessCheckerManager {
static::$checkers['warning'][0][] = 'ModifiedFiles';
static::$checkers['warning'][0][] = 'PhpSapi';
static::$checkers['error'][0][] = 'DiskSpace';
static::$checkers['error'][0][] = 'PendingDbUpdates';
static::$checkers['error'][0][] = 'ReadOnlyFilesystem';
return static::$checkers;
......
......@@ -15,5 +15,6 @@ files[] = ReadinessCheckers/DiskSpace.php
files[] = ReadinessCheckers/FileOwnership.php
files[] = ReadinessCheckers/MissingProjectInfo.php
files[] = ReadinessCheckers/ModifiedFiles.php
files[] = ReadinessCheckers/PendingDbUpdates.php
files[] = ReadinessCheckers/PhpSapi.php
files[] = ReadinessCheckers/ReadOnlyFilesystem.php
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment