You are here

function field_encrypt_enable in Field Encryption 7

Implements hook_enable().

File

./field_encrypt.install, line 11
Insallation functions for the Field Encryption module.

Code

function field_encrypt_enable() {

  // Clear the cache of existing data.
  cache_clear_all('*', 'cache_field', TRUE);

  // Set up the new class for this bin.
  $old_cache = variable_get('cache_class_cache_field', NULL);
  variable_set('field_encrypt_old_cache', $old_cache);
  $default_cache_class = variable_get('cache_default_class', 'DrupalDatabaseCache');
  switch ($default_cache_class) {
    case 'DrupalDatabaseCache':
      variable_set('cache_class_cache_field', 'FieldEncryptDatabaseCache');
      break;
    case 'MemCacheDrupal':
      variable_set('cache_class_cache_field', 'FieldEncryptMemCacheDrupal');
      break;
  }
}