Same name in other branches
  1. 6.0.x advagg.install \advagg_update_8301()
  2. 8.x-3.x advagg.install \advagg_update_8301()
  3. 8.x-4.x advagg.install \advagg_update_8301()

Implements hook_update_N().

Update Configuration options for 8.x-3.x.

File

./advagg.install, line 154

Code

function advagg_update_8301() {
    
    /** @var \Drupal\Core\Config\Config $config */
    $config = \Drupal::configFactory()->getEditable('advagg.settings');
    $config->clear('serializer')
        ->clear('css.ie')
        ->set('cache_level', 2)
        ->clear('debug')
        ->clear('include_base_url')
        ->clear('css.via_js')
        ->clear('root_dir_prefix')
        ->clear('core_groups')
        ->set('js.fix_type', $config->get('js_fix_type'))
        ->set('js.preserve_external', $config->get('js_preserve_external'))
        ->clear('js_preserve_external')
        ->clear('js_fix_type')
        ->set('css.brotli', TRUE)
        ->set('js.brotli', TRUE)
        ->set('immutable', TRUE)
        ->save();
    AssetOptimizer::generateHtaccess('css');
    AssetOptimizer::generateHtaccess('js');
}