function variable_get in Drupal 7
Same name and namespace in other branches
- 4 includes/bootstrap.inc \variable_get()
- 5 includes/bootstrap.inc \variable_get()
- 6 includes/bootstrap.inc \variable_get()
Returns 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 return.
$default: The default value to use if this variable has never been set.
Return value
The value of the variable. Unserialization is taken care of as necessary.
See also
656 calls to variable_get()
- ActionLoopTestCase::triggerActions in modules/
simpletest/ tests/ actions.test - Create an infinite loop by causing a watchdog message to be set, which causes the actions to be triggered again, up to actions_max_stack times.
- actions_do in includes/
actions.inc - Performs a given list of actions by executing their callback functions.
- AggregatorCronTestCase::testCron in modules/
aggregator/ aggregator.test - Adds feeds and updates them via cron process.
- aggregator_admin_form in modules/
aggregator/ aggregator.admin.inc - Form constructor for the aggregator system settings.
- aggregator_categorize_items in modules/
aggregator/ aggregator.pages.inc - Form constructor to build the page list form.
1 string reference to 'variable_get'
- system_test_menu in modules/
simpletest/ tests/ system_test.module - Implements hook_menu().
File
- includes/
bootstrap.inc, line 1235 - Functions that need to be loaded on every Drupal request.
Code
function variable_get($name, $default = NULL) {
global $conf;
return isset($conf[$name]) ? $conf[$name] : $default;
}