Gets the value of a variable from the database during 7.x-8.x upgrades.
Use this during the 7.x-8.x upgrade path instead of variable_get().
string $name: The name of the variable.
mixed $default: The default value of the variable.
mixed The value of the variable in the database unserialized, or NULL if not set.
function update_variable_get($name, $default = NULL) {
$result = db_query('SELECT value FROM {variable} WHERE name = :name', array(
':name' => $name,
))
->fetchField();
if ($result !== FALSE) {
return unserialize($result);
}
return $default;
}