You are here

function _ultimate_cron_variable_load_multiple in Ultimate Cron 7.2

Load multiple variables 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

array $names: Names of variables to load.

Return value

array Values of the variables. The values are also stored in the global static variables array, so variable_get() may retrieve the correct data afterwards.

File

./ultimate_cron.module, line 1166

Code

function _ultimate_cron_variable_load_multiple($names, $default = NULL) {
  $values = array();
  $result = db_query("SELECT name, value FROM {variable} WHERE name IN (:names)", array(
    ':names' => $names,
  ))
    ->fetchAllKeyed();
  global $conf;
  foreach ($names as $name) {
    $conf[$name] = $values[$name] = isset($result[$name]) ? unserialize($result[$name]) : $default;
  }
  return $values;
}