function InstallerKernel::getInstallProfile

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Installer/InstallerKernel.php \Drupal\Core\Installer\InstallerKernel::getInstallProfile()
  2. 8.9.x core/lib/Drupal/Core/Installer/InstallerKernel.php \Drupal\Core\Installer\InstallerKernel::getInstallProfile()
  3. 11.x core/lib/Drupal/Core/Installer/InstallerKernel.php \Drupal\Core\Installer\InstallerKernel::getInstallProfile()

Gets the active install profile.

Return value

string|false|null The name of the active install profile or distribution, FALSE if there is no install profile or NULL if Drupal is being installed.

Overrides DrupalKernel::getInstallProfile

File

core/lib/Drupal/Core/Installer/InstallerKernel.php, line 54

Class

InstallerKernel
Extend DrupalKernel to handle force some kernel behaviors.

Namespace

Drupal\Core\Installer

Code

public function getInstallProfile() {
  global $install_state;
  if ($install_state && empty($install_state['installation_finished'])) {
    // If the profile has been selected return it.
    if (isset($install_state['parameters']['profile'])) {
      $profile = $install_state['parameters']['profile'];
    }
    else {
      $profile = NULL;
    }
  }
  else {
    $profile = parent::getInstallProfile();
  }
  return $profile;
}

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