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()
3 string references to 'conf_path'

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;
}