function ConfigController::__construct

Same name in other branches
  1. 9 core/modules/config/src/Controller/ConfigController.php \Drupal\config\Controller\ConfigController::__construct()
  2. 10 core/modules/config/src/Controller/ConfigController.php \Drupal\config\Controller\ConfigController::__construct()
  3. 11.x core/modules/config/src/Controller/ConfigController.php \Drupal\config\Controller\ConfigController::__construct()

Constructs a ConfigController object.

Parameters

\Drupal\Core\Config\StorageInterface $target_storage: The target storage.

\Drupal\Core\Config\StorageInterface $sync_storage: The sync storage.

\Drupal\Core\Config\ConfigManagerInterface $config_manager: The config manager.

\Drupal\system\FileDownloadController $file_download_controller: The file download controller.

\Drupal\Core\Diff\DiffFormatter $diff_formatter: The diff formatter.

\Drupal\Core\File\FileSystemInterface $file_system: The file system.

\Drupal\Core\Config\StorageInterface $export_storage: The export storage.

\Drupal\Core\Config\ImportStorageTransformer $import_transformer: The import transformer service.

File

core/modules/config/src/Controller/ConfigController.php, line 116

Class

ConfigController
Returns responses for config module routes.

Namespace

Drupal\config\Controller

Code

public function __construct(StorageInterface $target_storage, StorageInterface $sync_storage, ConfigManagerInterface $config_manager, FileDownloadController $file_download_controller, DiffFormatter $diff_formatter, FileSystemInterface $file_system, StorageInterface $export_storage = NULL, ImportStorageTransformer $import_transformer = NULL) {
    $this->targetStorage = $target_storage;
    $this->syncStorage = $sync_storage;
    $this->configManager = $config_manager;
    $this->fileDownloadController = $file_download_controller;
    $this->diffFormatter = $diff_formatter;
    $this->fileSystem = $file_system;
    if (is_null($export_storage)) {
        @trigger_error('The config.storage.export service must be passed to ConfigController::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3037022.', E_USER_DEPRECATED);
        $export_storage = \Drupal::service('config.storage.export');
    }
    $this->exportStorage = $export_storage;
    if (is_null($import_transformer)) {
        @trigger_error('The config.import_transformer service must be passed to ConfigController::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3066005.', E_USER_DEPRECATED);
        $import_transformer = \Drupal::service('config.import_transformer');
    }
    $this->importTransformer = $import_transformer;
}

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