function conf_path

Returns the appropriate configuration directory.

Returns the configuration path based on the site's hostname, port, and pathname. Uses find_conf_path() to find the current configuration directory. See default.settings.php for examples on how the URL is converted to a directory.

Parameters

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.

bool $reset: Force a full search for matching directories even if one had been found previously. Defaults to FALSE.

Return value

The path of the matching directory.

See also

default.settings.php

38 calls to conf_path()
config_get_config_directory in drupal/core/includes/bootstrap.inc
Returns the path of a configuration directory.
DrupalKernelTest::testCompileDIC in drupal/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
Tests DIC compilation.
drupal_rewrite_settings in drupal/core/includes/install.inc
Replaces values in settings.php with values in the submitted array.
drupal_settings_initialize in drupal/core/includes/bootstrap.inc
Sets the base URL, cookie domain, and session name from configuration.
FileStorageTest::setUp in drupal/core/modules/system/lib/Drupal/system/Tests/PhpStorage/FileStorageTest.php
Overrides \Drupal\simpletest\UnitTestBase::setUp()

... See full list

3 string references to 'conf_path'
drupal_rewrite_settings in drupal/core/includes/install.inc
Replaces values in settings.php with values in the submitted array.
install_settings_form in drupal/core/includes/install.core.inc
Form constructor for a form to configure and rewrite settings.php.
install_verify_database_settings in drupal/core/includes/install.core.inc
Verifies that settings.php specifies a valid database connection.

File

drupal/core/includes/bootstrap.inc, line 433
Functions that need to be loaded on every Drupal request.

Code

function conf_path($require_settings = TRUE, $reset = FALSE) {
  $conf =& drupal_static(__FUNCTION__, '');
  if ($conf && !$reset) {
    return $conf;
  }
  $script_name = $_SERVER['SCRIPT_NAME'];
  if (!$script_name) {
    $script_name = $_SERVER['SCRIPT_FILENAME'];
  }
  $http_host = $_SERVER['HTTP_HOST'];
  $conf = find_conf_path($http_host, $script_name, $require_settings);
  return $conf;
}