Same name and namespace in other branches
- 4.6.x includes/bootstrap.inc \variable_get()
- 4.7.x includes/bootstrap.inc \variable_get()
- 5.x includes/bootstrap.inc \variable_get()
- 6.x 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
636 calls to variable_get()
- AggregatorTestCase::getDefaultFeedItemCount in modules/
aggregator/ aggregator.test - Returns the count of the randomly created feed array.
- 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.
- aggregator_expire in modules/
aggregator/ aggregator.processor.inc - Expires items from a feed depending on expiration settings.
- aggregator_filter_xss in modules/
aggregator/ aggregator.module - Renders the HTML content safely, as allowed.
1 string reference to 'variable_get'
- system_test_menu in modules/
simpletest/ tests/ system_test.module - Implements hook_menu().
File
- includes/
bootstrap.inc, line 1288 - 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;
}