/** * {@inheritdoc} */ public function submitForm(array &$form, array &$form_state) { drupal_clear_css_cache(); drupal_clear_js_cache(); // This form allows page compression settings to be changed, which can // invalidate cached pages in the render cache, so it needs to be cleared on // form submit. $this->renderCache->deleteAll(); $this->config('system.performance')->set('cache.page.use_internal', $form_state['values']['cache'])->set('cache.page.max_age', $form_state['values']['page_cache_maximum_age'])->set('response.gzip', $form_state['values']['page_compression'])->set('css.preprocess', $form_state['values']['preprocess_css'])->set('js.preprocess', $form_state['values']['preprocess_js'])->save(); parent::submitForm($form, $form_state); }
/** * @Given /^the "([^"]*)" cache bin has been cleared$/ */ public function theCacheBinHasBeenCleared($bin) { if ($bin == 'css' || $bin == 'js') { _drupal_flush_css_js(); drupal_clear_css_cache(); drupal_clear_js_cache(); } elseif ($bin == 'block') { cache_clear_all(null, 'cache_block'); } elseif ($bin == 'theme') { cache_clear_all('theme_registry', 'cache', true); } else { cache_clear_all(null, $bin); } }