You are here

gatsby_fastbuilds.drush.inc in Gatsby Live Preview & Incremental Builds 2.0.x

Same filename and directory in other branches
  1. 8 modules/gatsby_fastbuilds/gatsby_fastbuilds.drush.inc

Contains gatsby_fastbuilds drush 8 commands.

File

modules/gatsby_fastbuilds/gatsby_fastbuilds.drush.inc
View source
<?php

/**
 * @file
 * Contains gatsby_fastbuilds drush 8 commands.
 */

/**
 * Implements hook_drush_command().
 */
function gatsby_fastbuilds_drush_command() {
  $commands['gatsby-fastbuilds-delete'] = [
    'description' => 'Deletes all the Gatsby Fastbuilds Log entries.',
    'aliases' => [
      'gatsdel',
    ],
    'examples' => [
      'drush gatsdel' => 'Deletes all the Gatsby Fastbuilds Log entries.',
    ],
  ];
  return $commands;
}

/**
 * Deletes all the Gatsby Fastbuilds log entries.
 */
function drush_gatsby_fastbuilds_delete() {
  $time = time();
  \Drupal::service('gatsby.gatsby_logger')
    ->deleteExpiredLoggedEntities($time);

  // Store the log time in order to validate future syncs.
  \Drupal::state()
    ->set('gatsby_fastbuilds.last_logtime', $time);
}

Functions

Namesort descending Description
drush_gatsby_fastbuilds_delete Deletes all the Gatsby Fastbuilds log entries.
gatsby_fastbuilds_drush_command Implements hook_drush_command().