|
ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Class FileUploadImpl. More...
Inheritance diagram for ILIAS\FileUpload\FileUploadImpl:
Collaboration diagram for ILIAS\FileUpload\FileUploadImpl:Public Member Functions | ||||||||||||||||
| __construct (PreProcessorManager $processorManager, Filesystems $filesystems, GlobalHttpState $globalHttpState) | ||||||||||||||||
| FileUploadImpl constructor. More... | ||||||||||||||||
| moveOneFileTo (UploadResult $uploadResult, $destination, $location=Location::STORAGE, $file_name='', $override_existing=false) | ||||||||||||||||
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResult) to the given destination.The destination is a relative path which refers to the path of the location.
| ||||||||||||||||
| moveFilesTo ($destination, $location=Location::STORAGE) | ||||||||||||||||
| @inheritDoc More... | ||||||||||||||||
| uploadSizeLimit () | ||||||||||||||||
| @inheritDoc More... | ||||||||||||||||
| register (PreProcessor $preProcessor) | ||||||||||||||||
| @inheritDoc More... | ||||||||||||||||
| getResults () | ||||||||||||||||
| @inheritDoc More... | ||||||||||||||||
| hasUploads () | ||||||||||||||||
| @inheritDoc More... | ||||||||||||||||
| hasBeenProcessed () | ||||||||||||||||
Public Member Functions inherited from ILIAS\FileUpload\FileUpload | ||||||||||||||||
| moveFilesTo ($destination, $location=Location::STORAGE) | ||||||||||||||||
| Moves all uploaded files to the given destination after the processors had processed the files. More... | ||||||||||||||||
| moveOneFileTo (UploadResult $UploadResult, $destination, $location=Location::STORAGE, $file_name='', $override_existing=false) | ||||||||||||||||
| Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResult) to the given destination. More... | ||||||||||||||||
| uploadSizeLimit () | ||||||||||||||||
| Returns the current upload size limit in bytes. More... | ||||||||||||||||
| register (PreProcessor $preProcessor) | ||||||||||||||||
| Register a new preprocessor instance. More... | ||||||||||||||||
| process () | ||||||||||||||||
| Invokes all preprocessors for each uploaded file in the sequence they got registered. More... | ||||||||||||||||
| getResults () | ||||||||||||||||
| Returns the results of the processing and moving operation of the uploaded files. More... | ||||||||||||||||
| hasUploads () | ||||||||||||||||
| Return (bool)true if one ore more file-uploads are in the current request, (bool)false if not. More... | ||||||||||||||||
| hasBeenProcessed () | ||||||||||||||||
| Return (bool)true if the current upload has already been processed. More... | ||||||||||||||||
Protected Member Functions | |
| flattenUploadedFiles ($uploadedFiles) | |
Private Member Functions | |
| hardRemoveUpload (string $identifier) | |
| @description This is the very last thing we can do if a preprocessor DENIEs an upload. More... | |
| regenerateUploadResultWithPath (UploadResult $result, $path) | |
| Generate an exact copy of the result with the given path. More... | |
| regenerateUploadResultWithCopyError (UploadResult $result, $errorReason) | |
| Creates a clone of the given result and set the status to rejected with the passed error message. More... | |
| selectFilesystem ($location) | |
| Selects the correct filesystem by the given Location constant. More... | |
| rejectFailedUpload (UploadedFileInterface $file, Metadata $metadata) | |
| Reject a failed upload with the given metadata. More... | |
Private Attributes | |
| $processorManager | |
| $filesystems | |
| $globalHttpState | |
| $processed | |
| $moved | |
| $uploadResult | |
| $rejectedUploadResult | |
| $uploadStreams | |
| ILIAS\FileUpload\FileUploadImpl::__construct | ( | PreProcessorManager | $processorManager, |
| Filesystems | $filesystems, | ||
| GlobalHttpState | $globalHttpState | ||
| ) |
FileUploadImpl constructor.
| PreProcessorManager | $processorManager | The processor manager which should be used. |
| Filesystems | $filesystems | The Filesystems implementation which should be used. |
| GlobalHttpState | $globalHttpState | The http implementation which should be used to detect the uploaded files. |
Definition at line 91 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$filesystems, ILIAS\FileUpload\FileUploadImpl\$globalHttpState, ILIAS\FileUpload\FileUploadImpl\$processorManager, and ILIAS\Filesystem\filesystems().
Here is the call graph for this function:
|
protected |
| array | $uploadedFiles |
Definition at line 390 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasUploads().
Here is the caller graph for this function:| ILIAS\FileUpload\FileUploadImpl::getResults | ( | ) |
@inheritDoc
Implements ILIAS\FileUpload\FileUpload.
Definition at line 360 of file FileUploadImpl.php.
|
private |
@description This is the very last thing we can do if a preprocessor DENIEs an upload.
This is a hard removal, not beautiful, but it works.
Definition at line 106 of file FileUploadImpl.php.
| ILIAS\FileUpload\FileUploadImpl::hasBeenProcessed | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 407 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$processed.
| ILIAS\FileUpload\FileUploadImpl::hasUploads | ( | ) |
@inheritDoc
Implements ILIAS\FileUpload\FileUpload.
Definition at line 373 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\flattenUploadedFiles().
Here is the call graph for this function:| ILIAS\FileUpload\FileUploadImpl::moveFilesTo | ( | $destination, | |
$location = Location::STORAGE |
|||
| ) |
@inheritDoc
Implements ILIAS\FileUpload\FileUpload.
Definition at line 149 of file FileUploadImpl.php.
References $location, ILIAS\FileUpload\FileUploadImpl\$uploadResult, ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithCopyError(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithPath(), ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED, and ILIAS\FileUpload\FileUploadImpl\selectFilesystem().
Here is the call graph for this function:| ILIAS\FileUpload\FileUploadImpl::moveOneFileTo | ( | UploadResult | $uploadResult, |
| $destination, | |||
$location = Location::STORAGE, |
|||
$file_name = '', |
|||
$override_existing = false |
|||
| ) |
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResult) to the given destination.The destination is a relative path which refers to the path of the location.
| UploadResult | $UploadResult | Which upload result do you want to move? |
| string | $destination | Where do you want to move the file? |
| int | $location | Location::[STORAGE|WEB|CUSTOMIZING] |
| string | $file_name | Do you want to rename the file? |
| bool | $override_existing | Override existing file with same name |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 121 of file FileUploadImpl.php.
References $location, ILIAS\FileUpload\FileUploadImpl\$uploadResult, ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithCopyError(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithPath(), ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED, and ILIAS\FileUpload\FileUploadImpl\selectFilesystem().
Here is the call graph for this function:
|
private |
Creates a clone of the given result and set the status to rejected with the passed error message.
| UploadResult | $result | The result which should be cloned. |
| string | $errorReason | The reason why the error occurred. |
Definition at line 211 of file FileUploadImpl.php.
References $result, and ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
Here is the caller graph for this function:
|
private |
Generate an exact copy of the result with the given path.
| UploadResult | $result | The result which should be cloned. |
| string | $path | The path which should be set on the result clone. |
Definition at line 190 of file FileUploadImpl.php.
References $result.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
Here is the caller graph for this function:| ILIAS\FileUpload\FileUploadImpl::register | ( | PreProcessor | $preProcessor | ) |
@inheritDoc
Implements ILIAS\FileUpload\FileUpload.
Definition at line 264 of file FileUploadImpl.php.
|
private |
Reject a failed upload with the given metadata.
| UploadedFileInterface | $file | |
| Metadata | $metadata | The metadata used to create the rejected result. |
Definition at line 339 of file FileUploadImpl.php.
References $result, ILIAS\FileUpload\DTO\Metadata\getFilename(), ILIAS\FileUpload\DTO\Metadata\getMimeType(), ILIAS\FileUpload\DTO\Metadata\getUploadSize(), and ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED.
Here is the call graph for this function:
|
private |
Selects the correct filesystem by the given Location constant.
| int | $location | The storage location constant defined within the Location interface. |
InvalidArgumentException Thrown if the location is not a valid Location constant.
Definition at line 235 of file FileUploadImpl.php.
References $location, ILIAS\FileUpload\Location\CUSTOMIZING, ILIAS\Filesystem\filesystems(), ILIAS\FileUpload\Location\STORAGE, ILIAS\FileUpload\Location\TEMPORARY, and ILIAS\FileUpload\Location\WEB.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\FileUpload\FileUploadImpl::uploadSizeLimit | ( | ) |
@inheritDoc
Implements ILIAS\FileUpload\FileUpload.
Definition at line 255 of file FileUploadImpl.php.
|
private |
Definition at line 55 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 59 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 67 of file FileUploadImpl.php.
|
private |
Definition at line 63 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasBeenProcessed().
|
private |
Definition at line 51 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 75 of file FileUploadImpl.php.
|
private |
Definition at line 71 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
|
private |
Definition at line 79 of file FileUploadImpl.php.