You are here

protected function InstallProfile::getLatestSchemaVersion in Helper 8

Gets the latest schema version for an install profile.

Parameters

string $profile: The install profile name.

Return value

int The schema version.

1 call to InstallProfile::getLatestSchemaVersion()
InstallProfile::switch in src/InstallProfile.php
Switches the site's install profile.

File

src/InstallProfile.php, line 206

Class

InstallProfile
Helpers related to working with install profiles.

Namespace

Drupal\helper

Code

protected function getLatestSchemaVersion($profile) {
  module_load_install($profile);
  $versions = drupal_get_schema_versions($profile) ?? [];
  $versions[] = $this->moduleHandler
    ->invoke($profile, 'update_last_removed') ?? \Drupal::CORE_MINIMUM_SCHEMA_VERSION;
  return max($versions);
}