FileDumpController
Read onlyYes
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $eventDispatcher : EventDispatcherInterface
- $hashService : HashService
- $resourceFactory : ResourceFactory
- $responseFactory : ResponseFactoryInterface
Methods
- __construct() : mixed
- dumpAction() : ResponseInterface
- Main method to dump a file
- applyContentSecurityPolicy() : ResponseInterface
- Applies hard-coded content-security-policy (CSP) for file to be dumped.
- buildParametersFromRequest() : array<string|int, mixed>
- createFileObjectByParameters() : File|FileReference|ProcessedFile|null
- isFileValid() : bool
- isTokenValid() : bool
Properties
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$hashService
protected
HashService
$hashService
$resourceFactory
protected
ResourceFactory
$resourceFactory
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher, ResourceFactory $resourceFactory, ResponseFactoryInterface $responseFactory, HashService $hashService, FileNameValidator $fileNameValidator) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
- $resourceFactory : ResourceFactory
- $responseFactory : ResponseFactoryInterface
- $hashService : HashService
- $fileNameValidator : FileNameValidator
dumpAction()
Main method to dump a file
public
dumpAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Tags
Return values
ResponseInterfaceapplyContentSecurityPolicy()
Applies hard-coded content-security-policy (CSP) for file to be dumped.
protected
applyContentSecurityPolicy(ResourceInterface $file, ResponseInterface $response) : ResponseInterface
Parameters
- $file : ResourceInterface
- $response : ResponseInterface
Return values
ResponseInterfacebuildParametersFromRequest()
protected
buildParametersFromRequest(ServerRequestInterface $request) : array<string|int, mixed>
Parameters
- $request : ServerRequestInterface
Return values
array<string|int, mixed>createFileObjectByParameters()
protected
createFileObjectByParameters(array<string|int, mixed> $parameters) : File|FileReference|ProcessedFile|null
Parameters
- $parameters : array<string|int, mixed>
Return values
File|FileReference|ProcessedFile|nullisFileValid()
protected
isFileValid(FileInterface $file) : bool
Parameters
- $file : FileInterface
Return values
boolisTokenValid()
protected
isTokenValid(array<string|int, mixed> $parameters, ServerRequestInterface $request) : bool
Parameters
- $parameters : array<string|int, mixed>
- $request : ServerRequestInterface