class ConfigController implements ContainerInjectionInterface (View source)

Returns responses for config module routes.

Properties

protected StorageInterface $targetStorage

The target storage.

protected StorageInterface $syncStorage

The sync storage.

protected ImportStorageTransformer $importTransformer

The import transformer service.

protected ConfigManagerInterface $configManager

The configuration manager.

protected StorageInterface $exportStorage

The export storage.

protected FileDownloadController $fileDownloadController

The file download controller.

protected DiffFormatter $diffFormatter

The diff formatter.

protected FileSystemInterface $fileSystem

The file system.

Methods

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

__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)

Constructs a ConfigController object.

downloadExport()

Downloads a tarball of the site configuration.

array
diff(string $source_name, string $target_name = NULL, string $collection = NULL)

Shows diff of specified configuration file.

Details

static create(ContainerInterface $container)

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this instance should use.

__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)

Constructs a ConfigController object.

Parameters

StorageInterface $target_storage

The target storage.

StorageInterface $sync_storage

The sync storage.

ConfigManagerInterface $config_manager

The config manager.

FileDownloadController $file_download_controller

The file download controller.

DiffFormatter $diff_formatter

The diff formatter.

FileSystemInterface $file_system

The file system.

StorageInterface $export_storage

The export storage.

ImportStorageTransformer $import_transformer

The import transformer service.

downloadExport()

Downloads a tarball of the site configuration.

array diff(string $source_name, string $target_name = NULL, string $collection = NULL)

Shows diff of specified configuration file.

Parameters

string $source_name

The name of the configuration file.

string $target_name

(optional) The name of the target configuration file if different from the $source_name.

string $collection

(optional) The configuration collection name. Defaults to the default collection.

Return Value

array

Table showing a two-way diff between the active and staged configuration.