function ConfigImporter::processExtensions

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigImporter.php \Drupal\Core\Config\ConfigImporter::processExtensions()
  2. 8.9.x core/lib/Drupal/Core/Config/ConfigImporter.php \Drupal\Core\Config\ConfigImporter::processExtensions()
  3. 10 core/lib/Drupal/Core/Config/ConfigImporter.php \Drupal\Core\Config\ConfigImporter::processExtensions()

Processes extensions as a batch operation.

Parameters

array|\ArrayAccess $context: The batch context.

File

core/lib/Drupal/Core/Config/ConfigImporter.php, line 626

Class

ConfigImporter
Defines a configuration importer.

Namespace

Drupal\Core\Config

Code

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;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.