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

Run the advagg cron hook.

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

Fichier

src/Commands/AdvaggCommands.php, line 61

Classe

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.'));
    }
}