You are here

function _ec_variable_del in Elysia Cron 6.2

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

A substitute for variable_del to avoid cache management Use ONLY for variables setted during cron execution: elysia_cron_semaphore, elysia_cron_last_run, elysia_cron_last_context, cron_semaphore, cron_last WARN_UPGRADE

3 calls to _ec_variable_del()
drupal_clean_after_cron_run in ./elysia_drupalconv.php
elysia_cron_after_execution in ./elysia_cron.module
Use this after executing a cron handler
elysia_cron_unlock_env in ./elysia_cron.module
Unlock system locked with elysia_cron_lock_env

File

./elysia_cron.module, line 299

Code

function _ec_variable_del($name) {
  global $_ec_variables, $_ec_variables_allowed;
  if (!in_array($name, $_ec_variables_allowed)) {
    elysia_cron_error('Wrong variable passed to _ec_variable_del: !var', array(
      '!var' => $name,
    ), true);
    return variable_del($name);
  }
  if (!is_array($_ec_variables)) {
    _ec_variable_init();
  }
  if (EC_DRUPAL_VERSION >= 7) {
    db_delete('variable')
      ->condition('name', $name)
      ->execute();
  }
  else {
    if (!variable_get('elysia_cron_alternate_var_handler', false)) {
      db_lock_table('variable');
      db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
      db_unlock_tables();
    }
    else {
      db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
    }
  }
  unset($_ec_variables[$name]);
}