1 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

core/includes/update.inc, line 488
Backdrop site update API.

Code

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