function DrupalKernel::getInstallProfile

Same name in other branches
  1. 9 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getInstallProfile()
  2. 10 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getInstallProfile()
  3. 11.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getInstallProfile()

Gets the active install profile.

Return value

string|null The name of the any active install profile or distribution.

2 calls to DrupalKernel::getInstallProfile()
DrupalKernel::compileContainer in core/lib/Drupal/Core/DrupalKernel.php
Compiles a new service container.
InstallerKernel::getInstallProfile in core/lib/Drupal/Core/Installer/InstallerKernel.php
Gets the active install profile.
1 method overrides DrupalKernel::getInstallProfile()
InstallerKernel::getInstallProfile in core/lib/Drupal/Core/Installer/InstallerKernel.php
Gets the active install profile.

File

core/lib/Drupal/Core/DrupalKernel.php, line 1622

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getInstallProfile() {
    $config = $this->getConfigStorage()
        ->read('core.extension');
    if (isset($config['profile'])) {
        $install_profile = $config['profile'];
    }
    else {
        // If system_update_8300() has not yet run fallback to using settings.
        $settings = Settings::getAll();
        $install_profile = isset($settings['install_profile']) ? $settings['install_profile'] : NULL;
    }
    // Normalize an empty string to a NULL value.
    return empty($install_profile) ? NULL : $install_profile;
}

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