You are here

brightcove.drush.inc in Brightcove Video Connect 3.x

Same filename and directory in other branches
  1. 8.2 brightcove.drush.inc
  2. 8 brightcove.drush.inc

Contains custom Brightcove drush commands.

File

brightcove.drush.inc
View source
<?php

/**
 * @file
 * Contains custom Brightcove drush commands.
 */
use Drupal\brightcove\BrightcoveUtil;

/**
 * Implements hook_drush_command().
 */
function brightcove_drush_command() {
  $items = [];
  $items['brightcove-sync-all'] = [
    'description' => 'Initiates a Brightcove-to-Drupal sync by adding API clients to the queue.',
    'drupal dependencies' => [
      'brightcove',
    ],
    'callback' => 'drush_brightcove_sync_all',
    'aliases' => [
      'brightcove:sync-all',
      'bcsa',
    ],
  ];
  return $items;
}

/**
 * Implements drush_hook_COMMAND().
 */
function drush_brightcove_sync_all() {
  drush_print('Initiating Brightcove-to-Drupal sync...');
  BrightcoveUtil::runStatusQueues('sync', \Drupal::service('queue'));
  drush_backend_batch_process();
  drush_print('Sync complete.');
}

Functions

Namesort descending Description
brightcove_drush_command Implements hook_drush_command().
drush_brightcove_sync_all Implements drush_hook_COMMAND().