You are here

function apdqc_uninstall in Asynchronous Prefetch Database Query Cache 7

Implements hook_uninstall().

File

./apdqc.install, line 99
Handles APDQC installation and status checks.

Code

function apdqc_uninstall() {

  // Delete variables.
  variable_del('cache_garbage_collection_frequency');
  variable_del('apdqc_prefetch');
  variable_del('apdqc_verbose_devel_output');
  variable_del('apdqc_cron_timestamp');
  variable_del('apdqc_cron_frequency');
  variable_del('apdqc_semaphore_memory');
  variable_del('apdqc_table_collations');
  variable_del('apdqc_table_indexes');
  variable_del('apdqc_innodb');
  variable_del('apdqc_innodb_file_per_table');
  variable_del('apdqc_sessions_schema');
  variable_del('apdqc_semaphore_schema');

  // Check settings.php.
  $apdqcache_found = FALSE;
  foreach (variable_get('cache_backends', array()) as $include) {
    if (stripos($include, '/apdqc/apdqc.cache.inc') !== FALSE) {
      $apdqcache_found = TRUE;
      break;
    }
  }
  $lock_inc = variable_get('lock_inc', 'includes/lock.inc');
  if (stripos($lock_inc, '/apdqc/apdqc.lock.inc') !== FALSE) {
    $apdqcache_found = TRUE;
  }
  $session = variable_get('session_inc', 'includes/session.inc');
  if (stripos($session, '/apdqc/apdqc.session.inc') !== FALSE) {
    $apdqcache_found = TRUE;
  }
  if ($apdqcache_found) {
    drupal_set_message(t('Be sure to edit your settings.php file and remove the apdqc code in there.'), 'error');
  }
}