You are here

function kaltura_variable_get_real in Kaltura 7.3

Same name and namespace in other branches
  1. 5 includes/kaltura.admin.inc \kaltura_variable_get_real()
  2. 6.2 includes/kaltura.admin.inc \kaltura_variable_get_real()
  3. 6 includes/kaltura.admin.inc \kaltura_variable_get_real()
  4. 7.2 includes/kaltura.admin.inc \kaltura_variable_get_real()

Replace default Drupal's variable_get() function with a "real-time" one.

This function checks a variable status in the DB and not in the $_GLOBALS. TODO: why do we need this one????

1 call to kaltura_variable_get_real()
kaltura_test_notification_config in includes/kaltura.admin.inc
Helper function that tests the notification status of the module.

File

includes/kaltura.admin.inc, line 864
Contains functions for administration use of the kaltura core module.

Code

function kaltura_variable_get_real($var, $default) {
  $result = db_select('variable', 'v')
    ->fields('v')
    ->condition('name', $var, '=')
    ->execute()
    ->fetchAssoc();
  if (!$result) {
    return $default;
  }
  return unserialize($result['value']);
}