You are here

function drush_advagg_cron in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.2 advagg.drush.inc \drush_advagg_cron()
  2. 8.3 advagg.drush.inc \drush_advagg_cron()
  3. 7.2 advagg.drush.inc \drush_advagg_cron()

Callback function for drush advagg-cron.

Related topics

File

./advagg.drush.inc, line 155
Drush commands for Advanced CSS/JS Aggregation.

Code

function drush_advagg_cron() {

  // Run AdvAgg cron job.
  $output = advagg_cron(TRUE);
  if (!empty($output['css']) || !empty($output['js'])) {
    \Drupal::logger(dt('All stale aggregates have been deleted. %css_count CSS files and %js_count JS files have been removed.', [
      '%css_count' => count($output['css']),
      '%js_count' => count($output['js']),
    ]), 'ok');
  }
  else {
    \Drupal::logger(dt('No stale aggregates found. Nothing was deleted.'), 'ok');
  }
}