You are here

function lockr_field_encrypt_enable in Lockr 7.2

Same name and namespace in other branches
  1. 7.3 modules/lockr_field_encrypt/lockr_field_encrypt.install \lockr_field_encrypt_enable()

Implements hook_enable().

File

modules/lockr_field_encrypt/lockr_field_encrypt.install, line 6

Code

function lockr_field_encrypt_enable() {

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

  // Get the current cache class.
  $old_cache = variable_get('cache_class_cache_field', NULL);

  // If the current cache class was provided by FieldEncrypt.
  if (substr($old_cache, 0, 12) == 'FieldEncrypt') {

    // Save the cache class, then remove it.
    variable_set('lockr_field_encrypt_old_cache', $old_cache);
    variable_del('cache_class_cache_field');
  }
}