You are here

public function ExtensionDiscovery::setProfileDirectoriesFromSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/ExtensionDiscovery.php \Drupal\Core\Extension\ExtensionDiscovery::setProfileDirectoriesFromSettings()

Sets installation profile directories based on current site settings.

Return value

$this

1 call to ExtensionDiscovery::setProfileDirectoriesFromSettings()
ExtensionDiscovery::scan in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
Discovers available extensions of a given type.

File

core/lib/Drupal/Core/Extension/ExtensionDiscovery.php, line 229
Contains \Drupal\Core\Extension\ExtensionDiscovery.

Class

ExtensionDiscovery
Discovers available extensions in the filesystem.

Namespace

Drupal\Core\Extension

Code

public function setProfileDirectoriesFromSettings() {
  $this->profileDirectories = array();
  $profile = drupal_get_profile();

  // For SimpleTest to be able to test modules packaged together with a
  // distribution we need to include the profile of the parent site (in
  // which test runs are triggered).
  if (drupal_valid_test_ua() && !drupal_installation_attempted()) {
    $testing_profile = \Drupal::config('simpletest.settings')
      ->get('parent_profile');
    if ($testing_profile && $testing_profile != $profile) {
      $this->profileDirectories[] = drupal_get_path('profile', $testing_profile);
    }
  }

  // In case both profile directories contain the same extension, the actual
  // profile always has precedence.
  if ($profile) {
    $this->profileDirectories[] = drupal_get_path('profile', $profile);
  }
  return $this;
}