Commit b84cf878 authored by alexpott's avatar alexpott

Issue #2573443 by mikebell_: Remove conf_path() from core

parent c0186646
......@@ -122,47 +122,6 @@
*/
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.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment