function ConfigImporter::getNextExtensionOperation

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

Gets the next extension operation to perform.

Uninstalls are processed first with themes coming before modules. Then installs are processed with modules coming before themes. This order is necessary because themes can depend on modules.

Return value

array|bool An array containing the next operation and extension name to perform it on. If there is nothing left to do returns FALSE;

1 call to ConfigImporter::getNextExtensionOperation()
ConfigImporter::processExtensions in core/lib/Drupal/Core/Config/ConfigImporter.php
Processes extensions as a batch operation.

File

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

Class

ConfigImporter
Defines a configuration importer.

Namespace

Drupal\Core\Config

Code

protected function getNextExtensionOperation() {
    foreach ([
        'uninstall',
        'install',
    ] as $op) {
        $types = $op === 'uninstall' ? [
            'theme',
            'module',
        ] : [
            'module',
            'theme',
        ];
        foreach ($types as $type) {
            $unprocessed = $this->getUnprocessedExtensions($type);
            if (!empty($unprocessed[$op])) {
                return [
                    'op' => $op,
                    'type' => $type,
                    'name' => array_shift($unprocessed[$op]),
                ];
            }
        }
    }
    return FALSE;
}

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