Same name in other branches
  1. 6.0.x src/Commands/AdvaggCommands.php \Drupal\advagg\Commands\AdvaggCommands::cron()
  2. 8.x-3.x src/Commands/AdvaggCommands.php \Drupal\advagg\Commands\AdvaggCommands::cron()
  3. 8.x-4.x src/Commands/AdvaggCommands.php \Drupal\advagg\Commands\AdvaggCommands::cron()

Run the advagg cron hook.

@command advagg-cron @usage Standard example drush advagg-cron @aliases advagg-c

File

src/Commands/AdvaggCommands.php, line 61

Class

AdvaggCommands
Advagg commands for Drush 9+.

Namespace

Drupal\advagg\Commands

Code

public function cron() {
    // Run AdvAgg cron job.
    $output = advagg_cron(TRUE);
    if (!empty($output['css']) || !empty($output['js'])) {
        $this->logger()
            ->notice(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']),
        ]));
    }
    else {
        $this->logger()
            ->notice(dt('No stale aggregates found. Nothing was deleted.'));
    }
}