Same name in other branches
  1. 5.0.x advagg.drush.inc \drush_advagg_force_new_aggregates()
  2. 6.0.x advagg.drush.inc \drush_advagg_force_new_aggregates()
  3. 7.x-2.x advagg.drush.inc \drush_advagg_force_new_aggregates()
  4. 8.x-2.x advagg.drush.inc \drush_advagg_force_new_aggregates()
  5. 8.x-3.x advagg.drush.inc \drush_advagg_force_new_aggregates()

Callback function for drush advagg-force-new-aggregates.

Related topics

File

./advagg.drush.inc, line 115

Code

function drush_advagg_force_new_aggregates() {
    // Clear out the cache.
    drush_advagg_clear_all_files();
    // Increment counter.
    
    /** @var \Drupal\Core\Config\Config $config */
    $config = \Drupal::service('config.factory')->getEditable('advagg.settings');
    $new_value = $config->get('global_counter') + 1;
    $config->set('global_counter', $new_value)
        ->save();
    \Drupal::logger(dt('Global counter is now set to @new_value', [
        '@new_value' => $new_value,
    ]), 'ok');
    _drupal_flush_css_js();
}