You are here

function _ec_variable_set in Elysia Cron 7.2

Same name and namespace in other branches
  1. 5.2 elysia_cron.module \_ec_variable_set()
  2. 5 elysia_cron.module \_ec_variable_set()
  3. 6.2 elysia_cron.module \_ec_variable_set()
  4. 6 elysia_cron.module \_ec_variable_set()
  5. 7 elysia_cron.module \_ec_variable_set()

A substitute for variable_set to avoid cache management.

Use ONLY for variables set during cron execution: elysia_cron_semaphore, elysia_cron_last_run, elysia_cron_last_channel, cron_semaphore, cron_last. WARN_UPGRADE.

3 calls to _ec_variable_set()
elysia_cron_internal_execute_channel_completed in ./elysia_cron.module
Successful termination (after all shutdown hooks invoked by cron functions).
elysia_cron_run in ./elysia_cron.module
Public function to invoke a complete cron_run.
elysia_cron_set_last_channel in ./elysia_cron.module

File

./elysia_cron.module, line 291

Code

function _ec_variable_set($name, $value) {
  global $_ec_variables, $_ec_variables_allowed;
  if (!in_array($name, $_ec_variables_allowed)) {
    elysia_cron_error('Wrong variable passed to _ec_variable_set: !var', array(
      '!var' => $name,
    ), TRUE);
    variable_set($name, $value);
  }
  if (!is_array($_ec_variables)) {
    _ec_variable_init();
  }
  db_merge('variable')
    ->key(array(
    'name' => $name,
  ))
    ->fields(array(
    'value' => serialize($value),
  ))
    ->execute();
  $_ec_variables[$name] = $value;
}