protected ConfigImporter::processConfigurations(&$context)
Processes configuration as a batch operation.
Parameters
array|\ArrayAccess $context.: The batch context.
File
- core/lib/Drupal/Core/Config/ConfigImporter.php, line 568
Class
- ConfigImporter
- Defines a configuration importer.
Namespace
Drupal\Core\Config
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | protected function processConfigurations(& $context ) { // The first time this is called we need to calculate the total to process. // This involves recalculating the changelist which will ensure that if // extensions have been processed any configuration affected will be taken // into account. if ( $this ->totalConfigurationToProcess == 0) { $this ->storageComparer->reset(); foreach ( $this ->storageComparer->getAllCollectionNames() as $collection ) { foreach ( array ( 'delete' , 'create' , 'rename' , 'update' ) as $op ) { $this ->totalConfigurationToProcess += count ( $this ->getUnprocessedConfiguration( $op , $collection )); } } } $operation = $this ->getNextConfigurationOperation(); if (! empty ( $operation )) { if ( $this ->checkOp( $operation [ 'collection' ], $operation [ 'op' ], $operation [ 'name' ])) { $this ->processConfiguration( $operation [ 'collection' ], $operation [ 'op' ], $operation [ 'name' ]); } if ( $operation [ 'collection' ] == StorageInterface::DEFAULT_COLLECTION) { $context [ 'message' ] = $this ->t( 'Synchronizing configuration: @op @name.' , array ( '@op' => $operation [ 'op' ], '@name' => $operation [ 'name' ])); } else { $context [ 'message' ] = $this ->t( 'Synchronizing configuration: @op @name in @collection.' , array ( '@op' => $operation [ 'op' ], '@name' => $operation [ 'name' ], '@collection' => $operation [ 'collection' ])); } $processed_count = 0; foreach ( $this ->storageComparer->getAllCollectionNames() as $collection ) { foreach ( array ( 'delete' , 'create' , 'rename' , 'update' ) as $op ) { $processed_count += count ( $this ->processedConfiguration[ $collection ][ $op ]); } } $context [ 'finished' ] = $processed_count / $this ->totalConfigurationToProcess; } else { $context [ 'finished' ] = 1; } } |
Please login to continue.