getNextExtensionOperation example

$sync_steps[] = 'finish';
    return $sync_steps;
  }

  /** * Processes extensions as a batch operation. * * @param array|\ArrayAccess $context * The batch context. */
  protected function processExtensions(&$context) {
    $operation = $this->getNextExtensionOperation();
    if (!empty($operation)) {
      $this->processExtension($operation['type']$operation['op']$operation['name']);
      $context['message'] = t('Synchronizing extensions: @op @name.', ['@op' => $operation['op'], '@name' => $operation['name']]);
      $processed_count = count($this->processedExtensions['module']['install']) + count($this->processedExtensions['module']['uninstall']);
      $processed_count += count($this->processedExtensions['theme']['uninstall']) + count($this->processedExtensions['theme']['install']);
      $context['finished'] = $processed_count / $this->totalExtensionsToProcess;
    }
    else {
      $context['finished'] = 1;
    }
  }

  
Home | Imprint | This part of the site doesn't use cookies.