You are here

filehash.drush.inc in File Hash 8

Drush integration for File Hash module.

File

filehash.drush.inc
View source
<?php

/**
 * @file
 * Drush integration for File Hash module.
 */
use Drupal\filehash\Batch\GenerateBatch;

/**
 * Implements hook_drush_command().
 */
function filehash_drush_command() {
  $commands['filehash-generate'] = [
    'description' => 'Generate hashes for existing files.',
    'examples' => [
      'drush filehash-generate',
    ],
    'aliases' => [
      'fgen',
    ],
  ];
  return $commands;
}

/**
 * Drush callback for filehash-generate command.
 */
function drush_filehash_generate() {
  batch_set(GenerateBatch::createBatch());
  $batch =& batch_get();
  $batch['progressive'] = FALSE;
  drush_backend_batch_process();
}

Functions

Namesort descending Description
drush_filehash_generate Drush callback for filehash-generate command.
filehash_drush_command Implements hook_drush_command().