Problem/Motivation

In conf_path() in bootstrap.inc, the return value is named $conf. This is confusing, since it would seem to refer to the $conf array instead of what actually is: the string containing the $conf_path used for settings.php.

Proposed resolution

Rename the variable to $conf_path.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

foopang’s picture

Status: Active » Needs review
FileSize
942 bytes
xjm’s picture

Status: Needs review » Needs work
Issue tags: +Novice

The last submitted patch, rename-conf_path-1960764-1.patch, failed testing.

foopang’s picture

Status: Needs work » Needs review
FileSize
938 bytes

Rerolling the patch.

xjm’s picture

Status: Needs review » Needs work

The new hunk will need to be updated too:

  // Check for a simpletest override.                                           
  if ($simpletest_conf_path = _drupal_simpletest_conf_path()) {
    $conf = $simpletest_conf_path;
    return $conf;
  }
foopang’s picture

Oops, sorry. Rerolled the patch again.

foopang’s picture

Status: Needs work » Needs review
xjm’s picture

Status: Needs review » Reviewed & tested by the community

Here's the whole function with the latest patch applied:

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

Thanks @foopang!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed dad84f0 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.