diff --git a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php index 3861ca8..3f97ccd 100644 --- a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php +++ b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php @@ -23,23 +23,23 @@ class ConfigController implements ControllerInterface { /** * The target storage. * - * @var \Drupal\Core\Config\StorageInterface; + * @var \Drupal\Core\Config\StorageInterface */ protected $targetStorage; /** * The source storage. * - * @var \Drupal\Core\Config\StorageInterface; + * @var \Drupal\Core\Config\StorageInterface */ protected $sourceStorage; /** - * The module handler. + * The file download controller. * - * @var \Drupal\Core\Extension\ModuleHandlerInterface + * @var \Drupal\system\FileDownloadController */ - protected $moduleHandler; + protected $fileDownloadController; /** * {@inheritdoc} @@ -48,7 +48,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('config.storage'), $container->get('config.storage.staging'), - $container->get('module_handler') + FileDownloadController::create($container) ); } @@ -59,13 +59,13 @@ public static function create(ContainerInterface $container) { * The target storage. * @param \Drupal\Core\Config\StorageInterface $source_storage * The source storage - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler. + * @param \Drupal\Core\Controller\ControllerInterface $file_download_controller + * The file download controller. */ - public function __construct(StorageInterface $target_storage, StorageInterface $source_storage, ModuleHandlerInterface $module_handler) { + public function __construct(StorageInterface $target_storage, StorageInterface $source_storage, ControllerInterface $file_download_controller) { $this->targetStorage = $target_storage; $this->sourceStorage = $source_storage; - $this->moduleHandler = $module_handler; + $this->fileDownloadController = $file_download_controller; } /** @@ -80,9 +80,8 @@ public function downloadExport() { } $archiver->createModify($config_files, '', config_get_config_directory()); - $file_controller = new FileDownloadController($this->moduleHandler); $request = new Request(array('file' => 'config.tar.gz')); - return $file_controller->download($request, 'temporary'); + return $this->fileDownloadController->download($request, 'temporary'); } /**