function conf_path

cis7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)
cle7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)
elmsmedia7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)
icor7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)
meedjum_blog7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)
mooc7 bootstrap.inc conf_path($require_settings = TRUE, $reset = FALSE)

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

36 calls to conf_path()
at_core_filemanagement_form in sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/settings.filemanagement.inc
@file Generate form elments for the File Management settings.
cis_helper_quick_setup_page in profiles/cis/modules/custom/cis_helper/cis_helper.pages.inc
Callback for quick setup page to build a lot of elements at once.
cis_helper_quick_setup_page_submit in profiles/cis/modules/custom/cis_helper/cis_helper.pages.inc
Implements hook_submit().
DatabaseTasks_sqlite::getFormOptions in includes/database/sqlite/install.inc
Return driver specific configuration options.
DrupalPublicStreamWrapper::getDirectoryPath in includes/stream_wrappers.inc
Implements abstract public function getDirectoryPath()

... See full list

3 string references to 'conf_path'
drupal_rewrite_settings in includes/install.inc
Replaces values in settings.php with values in the submitted array.
install_settings_form in includes/install.core.inc
Form constructor for a form to configure and rewrite settings.php.
install_verify_settings in includes/install.core.inc
Verifies the existing settings in settings.php.

File

includes/bootstrap.inc, line 541
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;
  }

  $confdir = 'sites';

  $sites = array();
  if (file_exists(DRUPAL_ROOT . '/' . $confdir . '/sites.php')) {
    // This will overwrite $sites with the desired mappings.
    include (DRUPAL_ROOT . '/' . $confdir . '/sites.php');
  }

  $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
  $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
  for ($i = count($uri) - 1; $i > 0; $i--) {
    for ($j = count($server); $j > 0; $j--) {
      $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
      if (isset($sites[$dir]) && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $sites[$dir])) {
        $dir = $sites[$dir];
      }
      if (file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $dir))) {
        $conf = "$confdir/$dir";
        return $conf;
      }
    }
  }
  $conf = "$confdir/default";
  return $conf;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.