You are here

function features_flush_caches in Features 7.2

Same name and namespace in other branches
  1. 6 features.module \features_flush_caches()
  2. 7 features.module \features_flush_caches()

Implements hook_flush_caches().

File

./features.module, line 309
Main *.module file for the 'features' module.

Code

function features_flush_caches() {
  if (($modules_changed = variable_get('features_modules_changed', FALSE)) || variable_get('features_rebuild_on_flush', TRUE)) {
    if ($modules_changed) {
      variable_set('features_modules_changed', FALSE);
    }
    features_rebuild();

    // Don't flush the modules cache during installation, for performance
    // reasons.
    if (variable_get('install_task') == 'done') {
      features_get_modules(NULL, TRUE);
    }
  }
  if (db_table_exists('cache_features')) {
    return array(
      'cache_features',
    );
  }
  return array();
}