You are here

function _ultimate_cron_variable_load in Ultimate Cron 7.2

Load a variable by-passing the cache.

We update the the cron_last variable once a minute. In order to avoid clearing the variable cache every minute, we handle that variable directly.

Parameters

string $name: Name of variable to load.

Return value

mixed Value of the variable. The value is also stored in the global static variables array, so variable_get() may retrieve the correct data afterwards.

2 calls to _ultimate_cron_variable_load()
UltimateCronBackgroundProcessLegacyLauncher::poormanLauncher in plugins/ultimate_cron/launcher/background_process_legacy.class.php
Poorman launcher background process callback.
ultimate_cron_init in ./ultimate_cron.module
Implements hook_init().

File

./ultimate_cron.module, line 1139

Code

function _ultimate_cron_variable_load($name, $default = NULL) {
  if ($value = db_query("SELECT value FROM {variable} WHERE name = :name", array(
    ':name' => $name,
  ))
    ->fetchField()) {
    $value = unserialize($value);
  }
  else {
    $value = $default;
  }
  global $conf;
  $conf[$name] = $value;
  return $value;
}