reverted: --- b/core/includes/bootstrap.inc +++ a/core/includes/bootstrap.inc @@ -137,6 +137,47 @@ define('DRUPAL_ROOT', dirname(dirname(__DIR__))); /** + * Returns the appropriate configuration directory. + * + * @param bool $require_settings + * Only configuration directories with an existing settings.php file + * will be recognized. Defaults to TRUE. During initial installation, + * this is set to FALSE so that Drupal can detect a matching directory, + * then create a new settings.php file in it. + * @param bool $reset + * Force a full search for matching directories even if one had been + * found previously. Defaults to FALSE. + * @param \Symfony\Component\HttpFoundation\Request $request + * (optional) The current request. Defaults to \Drupal::request() or a new + * request created from globals. + * + * @return string + * The path of the matching directory.@see default.settings.php + * + * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. + * Use \Drupal\Core\DrupalKernel::getSitePath() instead. If the kernel is + * unavailable or the site path needs to be recalculated then + * Drupal\Core\DrupalKernel::findSitePath() can be used. + */ +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; +} +/** * Returns the path of a configuration directory. * * @param string $type reverted: --- b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php +++ a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php @@ -153,7 +153,7 @@ } // Search the site-specific directory. + $searchdirs[static::ORIGIN_SITE] = conf_path(); - $searchdirs[static::ORIGIN_SITE] = \Drupal::service('kernel')->getSitePath(); // Unless an explicit value has been passed, manually check whether we are // in a test environment, in which case test extensions must be included. diff -u b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php --- b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php @@ -63,7 +63,13 @@ * The base path for public:// typically sites/default/files. */ public static function basePath() { - $base_path = Settings::get('file_public_path', DrupalKernel::findSitePath(Request::createFromGlobals()) . '/files'); + if (\Drupal::hasService('kernel')) { + $site_path = $site_path = \Drupal::service('kernel')->getSitePath(); + } + else { + $site_path = DrupalKernel::findSitePath(Request::createFromGlobals()); + } + $base_path = Settings::get('file_public_path', $site_path . '/files'); return $base_path; }