Specialized variable_set() that works even if the child site is not upgraded.
@todo Update for D8 configuration system.
$name: The name of the variable to set.
$value: The value to set. This can be any PHP data type; these functions take care of serialization as necessary.
protected function variable_set($name, $value) {
db_delete('variable')
->condition('name', $name)
->execute();
db_insert('variable')
->fields(array(
'name' => $name,
'value' => serialize($value),
))
->execute();
try {
cache()
->delete('variables');
cache('bootstrap')
->delete('variables');
} catch (Exception $e) {
}
}