function update_system_schema_requirements

Same name in other branches
  1. 9 core/includes/update.inc \update_system_schema_requirements()
  2. 8.9.x core/includes/update.inc \update_system_schema_requirements()
  3. 10 core/includes/update.inc \update_system_schema_requirements()

Returns whether the minimum schema requirement has been satisfied.

Return value

array A requirements info array.

1 call to update_system_schema_requirements()
update_check_requirements in core/includes/update.inc
Checks update requirements and reports errors and (optionally) warnings.

File

core/includes/update.inc, line 22

Code

function update_system_schema_requirements() {
    $requirements = [];
    $system_schema = \Drupal::service('update.update_hook_registry')->getInstalledVersion('system');
    $requirements['minimum schema']['title'] = 'Minimum schema version';
    if ($system_schema >= \Drupal::CORE_MINIMUM_SCHEMA_VERSION) {
        $requirements['minimum schema'] += [
            'value' => 'The installed schema version meets the minimum.',
            'description' => 'Schema version: ' . $system_schema,
        ];
    }
    else {
        $requirements['minimum schema'] += [
            'value' => 'The installed schema version does not meet the minimum.',
            'severity' => REQUIREMENT_ERROR,
            'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must upgrade your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade.',
        ];
    }
    return $requirements;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.