Full ELMS Learning Network documentation
function variable_set
cis7 bootstrap.inc | variable_set($name, $value) |
cle7 bootstrap.inc | variable_set($name, $value) |
elmsmedia7 bootstrap.inc | variable_set($name, $value) |
icor7 bootstrap.inc | variable_set($name, $value) |
meedjum_blog7 bootstrap.inc | variable_set($name, $value) |
mooc7 bootstrap.inc | variable_set($name, $value) |
Sets a persistent variable.
Case-sensitivity of the variable_* functions depends on the database collation used. To avoid problems, always use lower case for persistent variable names.
Parameters
$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.
See also
411 calls to variable_set()
- addanother_update_7001 in sites/
all/ modules/ ulmus/ addanother/ addanother.install - Port over to the new variable storage system.
- admin_menu_toggle_modules in sites/
all/ modules/ ulmus/ admin_menu/ admin_menu.inc - Menu callback; Enable/disable developer modules.
- admin_theme_form_system_themes_form_alter_submit in sites/
all/ modules/ ulmus/ admin_theme/ admin_theme.module - Process system_themes_form additions submissions.
- advagg_cron in sites/
all/ modules/ ulmus/ advagg/ advagg.module - Implements hook_cron().
- advagg_css_compress_admin_settings_form_submit in sites/
all/ modules/ ulmus/ advagg/ advagg_css_compress/ advagg_css_compress.admin.inc - Clear out the advagg cache bin when the save configuration button is pressed.
File
- includes/
bootstrap.inc, line 973 - Functions that need to be loaded on every Drupal request.
Code
function variable_set($name, $value) {
global $conf;
db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
cache_clear_all('variables', 'cache_bootstrap');
$conf[$name] = $value;
}