function DrupalBoot8::conf_path

8.0.x DrupalBoot8.php DrupalBoot8::conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL)
master DrupalBoot8.php DrupalBoot8::conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL)

Overrides DrupalBoot::conf_path

2 calls to DrupalBoot8::conf_path()

File

lib/Drush/Boot/DrupalBoot8.php, line 54

Namespace

Drush\Boot

Class

DrupalBoot8

Code

function conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL) {
  if (!isset($request)) {
    if (\Drupal::hasRequest()) {
      $request = \Drupal::request();
    }
    // @todo Remove once external CLI scripts (Drush) are updated.
    else {
      $request = Request::createFromGlobals();
    }
  }
  if (\Drupal::hasService('kernel')) {
    $site_path = \Drupal::service('kernel')->getSitePath();
  }
  if (!isset($site_path) || empty($site_path)) {
    $site_path = DrupalKernel::findSitePath($request, $require_settings);
  }
  return $site_path;
}