1.20.x update.inc update_variable_set($name, $value)

Sets a persistent variable during update hooks.

Use this during the upgrade path instead of variable_set().

Parameters

string $name: The name of the variable.

mixed $value: The value of the variable to be set.

File

includes/update.inc, line 396
Backdrop database update API.

Code

function update_variable_set($name, $value) {
  db_merge('variable')
    ->key(array(
      'name' => $name,
    ))
    ->fields(array(
      'value' => serialize($value),
    ))
    ->execute();
}