protected function SystemListingInfo::profiles

Overrides Drupal\Core\SystemListing::profiles().

Overrides SystemListing::profiles

File

drupal/core/lib/Drupal/Core/SystemListingInfo.php, line 20
Definition of Drupal\Core\SystemListingInfo.

Class

SystemListingInfo
Returns information about system object files (modules, themes, etc.).

Namespace

Drupal\Core

Code

protected function profiles($directory) {
  $searchdir = array();

  // The 'core/profiles' directory contains pristine collections of modules
  // and themes as provided by a distribution. It is pristine in the same
  // way that the 'core/modules' directory is pristine for core; users
  // should avoid any modification by using the top-level or sites/<domain>
  // directories.
  $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 = config('simpletest.settings')
      ->get('parent_profile');
    if ($testing_profile && $testing_profile != $profile) {
      $searchdir[] = drupal_get_path('profile', $testing_profile) . '/' . $directory;
    }
  }

  // In case both profile directories contain the same extension, the actual
  // profile always has precedence.
  $searchdir[] = drupal_get_path('profile', $profile) . '/' . $directory;
  return $searchdir;
}