You are here

function _drupal_rewrite_settings_dump_one in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/install.inc \_drupal_rewrite_settings_dump_one()
  2. 9 core/includes/install.inc \_drupal_rewrite_settings_dump_one()

Helper for drupal_rewrite_settings().

Dump the value of a value property and adds the comment if it exists.

Parameters

object $variable: A stdClass object with at least a value property.

string $prefix: A string to prepend to the variable's value.

string $suffix: A string to append to the variable's value.

Return value

string A string containing valid PHP code of the variable suitable for placing into settings.php.

2 calls to _drupal_rewrite_settings_dump_one()
drupal_rewrite_settings in core/includes/install.inc
Replaces values in settings.php with values in the submitted array.
_drupal_rewrite_settings_dump in core/includes/install.inc
Helper for drupal_rewrite_settings().

File

core/includes/install.inc, line 517
API functions for installing modules and themes.

Code

function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '') {
  $return = $prefix . var_export($variable->value, TRUE) . ';';
  if (!empty($variable->comment)) {
    $return .= ' // ' . $variable->comment;
  }
  $return .= $suffix;
  return $return;
}