You are here

function drush_formassembly_fasync in FormAssembly 7

Callback function for drush command to sync with FormAssembly

File

./formassembly.drush.inc, line 13
Drush command file

Code

function drush_formassembly_fasync() {
  $use_admin = variable_get('formassembly_admin_index', FALSE);
  $batch = array(
    'operations' => array(
      array(
        'formassembly_batch_get_forms',
        array(
          $use_admin,
        ),
      ),
      array(
        'formassembly_batch_extract_forms',
        array(),
      ),
    ),
    'finished' => 'formassembly_batch_get_finished',
    'title' => 'Request Forms Data from FormAssembly',
    'init_message' => 'Contacting FormAssembly',
  );
  batch_set($batch);

  //the current batch is not generally manipulated outside of the batch api but we need to set progressive to false
  $batch =& batch_get();
  $batch['progressive'] = false;
  drush_backend_batch_process();
}