class ConfigPartialExportController in Config Partial Export 8
Returns responses for config module routes.
Hierarchy
- class \Drupal\config_partial_export\Controller\ConfigPartialExportController implements ContainerInjectionInterface
Expanded class hierarchy of ConfigPartialExportController
File
- src/
Controller/ ConfigPartialExportController.php, line 13
Namespace
Drupal\config_partial_export\ControllerView source
class ConfigPartialExportController implements ContainerInjectionInterface {
/**
* The file download controller.
*
* @var \Drupal\system\FileDownloadController
*/
protected $fileDownloadController;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(new FileDownloadController(\Drupal::service('stream_wrapper_manager')));
}
/**
* Constructs a ConfigController object.
*
* @param \Drupal\system\FileDownloadController $file_download_controller
* The file download controller.
*/
public function __construct(FileDownloadController $file_download_controller) {
$this->fileDownloadController = $file_download_controller;
}
/**
* Downloads a tarball of the site configuration.
*/
public function downloadExport() {
$request = new Request([
'file' => 'config_partial.tar.gz',
]);
$result = $this->fileDownloadController
->download($request, 'temporary');
return $result;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigPartialExportController:: |
protected | property | The file download controller. | |
ConfigPartialExportController:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
ConfigPartialExportController:: |
public | function | Downloads a tarball of the site configuration. | |
ConfigPartialExportController:: |
public | function | Constructs a ConfigController object. |