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

37 calls to conf_path()
BareMinimalNoConfigUpgradePathTest::refreshVariables in drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalNoConfigUpgradePathTest.php
Overrides \Drupal\system\Tests\Upgrade\UpgradePathTestBase::refreshVariables().
config_get_config_directory in drupal/core/includes/bootstrap.inc
Returns the path of a configuration directory.
DirectoryTest::testFileCheckLocalDirectoryHandling in drupal/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
Test local directory handling functions.
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.

... See full list

3 string references to 'conf_path'
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.
_drupal_load_test_overrides in drupal/core/includes/bootstrap.inc
Overrides low-level and environment-specific configuration.

File

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

Code

function conf_path($require_settings = TRUE, $reset = FALSE) {
  $conf_path =& drupal_static(__FUNCTION__, '');
  if ($conf_path && !$reset) {
    return $conf_path;
  }

  // Check for a simpletest override.
  if ($simpletest_conf_path = _drupal_simpletest_conf_path()) {
    $conf_path = $simpletest_conf_path;
    return $conf_path;
  }

  // Otherwise, use the normal $conf_path.
  $script_name = $_SERVER['SCRIPT_NAME'];
  if (!$script_name) {
    $script_name = $_SERVER['SCRIPT_FILENAME'];
  }
  $http_host = $_SERVER['HTTP_HOST'];
  $conf_path = find_conf_path($http_host, $script_name, $require_settings);
  return $conf_path;
}