The function that is responsible for loading the values of the Drupal variables in memory is variable_init(), which executes the following code:
if ($cached = cache_get('variables', 'cache')) {
$variables = $cached->data;
}
else {
$result = db_query('SELECT * FROM {variable}');
while ($variable = db_fetch_object($result)) {
$variables[$variable->name] = unserialize($variable->value);
}
cache_set('variables', $variables);
}
foreach ($conf as $name => $value) {
$variables[$name] = $value;
}
$conf
, the value passed to the function from _drupal_bootstrap() is the array read from the settings.php file. The function that reads the configuration file is conf_init(), which is called from _drupal_bootstrap()
before calling variable_init()
.
As you see in the code, the values read from the database are then overwritten with the values find in the $conf
array.
Similar code is present in Drupal 7 (see drupal_bootstrap(), _drupal_bootstrap_configuration(), and _drupal_bootstrap_variables()).
The only way to use the value read from the database is to remove the value set in settings.php.