function _drupal_rewrite_settings_dump_one

Same name in other branches
  1. 9 core/includes/install.inc \_drupal_rewrite_settings_dump_one()
  2. 8.9.x 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.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use SettingsEditor::rewrite() instead. As internal API, _drupal_rewrite_settings_dump_one() may also be removed in a minor release.

See also

https://www.drupal.org/node/3244583

1 call to _drupal_rewrite_settings_dump_one()
_drupal_rewrite_settings_dump in core/includes/install.inc
Helper for drupal_rewrite_settings().

File

core/includes/install.inc, line 430

Code

function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '') {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use SettingsEditor::rewrite() instead. As internal API, ' . __FUNCTION__ . '() may also be removed in a minor release. See https://www.drupal.org/node/3244583', E_USER_DEPRECATED);
    $return = $prefix . var_export($variable->value, TRUE) . ';';
    if (!empty($variable->comment)) {
        $return .= ' // ' . $variable->comment;
    }
    $return .= $suffix;
    return $return;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.