ILIAS
release_8 Revision v8.19
|
Class FileUploadImpl. More...
Public Member Functions | ||||||||||||||||
__construct (PreProcessorManager $processorManager, Filesystems $filesystems, GlobalHttpState $globalHttpState) | ||||||||||||||||
FileUploadImpl constructor. More... | ||||||||||||||||
moveOneFileTo (UploadResult $uploadResult, string $destination, int $location=Location::STORAGE, string $file_name='', bool $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 (string $destination, int $location=Location::STORAGE) | ||||||||||||||||
uploadSizeLimit () | ||||||||||||||||
register (PreProcessor $preProcessor) | ||||||||||||||||
process () | ||||||||||||||||
getResults () | ||||||||||||||||
hasUploads () | ||||||||||||||||
hasBeenProcessed () | ||||||||||||||||
Return (bool)true if the current upload has already been processed. More... | ||||||||||||||||
Protected Member Functions | |
flattenUploadedFiles (array $uploadedFiles) | |
Private Member Functions | |
hardRemoveUpload (string $identifier, string $rejection_message) | |
This is the very last thing we can do if a preprocessor DENIEs an upload. More... | |
regenerateUploadResultWithPath (UploadResult $result, string $path) | |
Generate an exact copy of the result with the given path. More... | |
regenerateUploadResultWithCopyError (UploadResult $result, string $errorReason) | |
Creates a clone of the given result and set the status to rejected with the passed error message. More... | |
selectFilesystem (int $location) | |
Selects the correct filesystem by the given Location constant. More... | |
rejectFailedUpload (Metadata $metadata) | |
Reject a failed upload with the given metadata. More... | |
Private Attributes | |
PreProcessorManager | $processorManager |
Filesystems | $filesystems |
GlobalHttpState | $globalHttpState |
bool | $processed |
bool | $moved |
array | $uploadResult |
array | $rejectedUploadResult |
array | $uploadStreams = null |
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 78 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$filesystems, ILIAS\FileUpload\FileUploadImpl\$globalHttpState, ILIAS\FileUpload\FileUploadImpl\$processorManager, and ILIAS\Filesystem\filesystems().
|
protected |
Definition at line 366 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasUploads(), and ILIAS\FileUpload\FileUploadImpl\process().
ILIAS\FileUpload\FileUploadImpl::getResults | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 341 of file FileUploadImpl.php.
|
private |
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 93 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\process().
ILIAS\FileUpload\FileUploadImpl::hasBeenProcessed | ( | ) |
Return (bool)true if the current upload has already been processed.
Implements ILIAS\FileUpload\FileUpload.
Definition at line 380 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$processed.
ILIAS\FileUpload\FileUploadImpl::hasUploads | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 354 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\flattenUploadedFiles().
ILIAS\FileUpload\FileUploadImpl::moveFilesTo | ( | string | $destination, |
int | $location = Location::STORAGE |
||
) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 138 of file FileUploadImpl.php.
References ILIAS\LTI\ToolProvider\$key, $location, $path, ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithCopyError(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithPath(), ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED, and ILIAS\FileUpload\FileUploadImpl\selectFilesystem().
ILIAS\FileUpload\FileUploadImpl::moveOneFileTo | ( | UploadResult | $uploadResult, |
string | $destination, | ||
int | $location = Location::STORAGE , |
||
string | $file_name = '' , |
||
bool | $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 108 of file FileUploadImpl.php.
References $location, $path, ILIAS\FileUpload\DTO\UploadResult\getName(), ILIAS\FileUpload\DTO\UploadResult\getPath(), ILIAS\FileUpload\DTO\UploadResult\getStatus(), ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithCopyError(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithPath(), ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED, and ILIAS\FileUpload\FileUploadImpl\selectFilesystem().
ILIAS\FileUpload\FileUploadImpl::process | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 264 of file FileUploadImpl.php.
References Vendor\Package\$e, ILIAS\FileUpload\DTO\ProcessingStatus\DENIED, ILIAS\FileUpload\FileUploadImpl\flattenUploadedFiles(), ILIAS\FileUpload\FileUploadImpl\hardRemoveUpload(), ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), and ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload().
|
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 200 of file FileUploadImpl.php.
References ILIAS\FileUpload\DTO\UploadResult\getMetaData(), ILIAS\FileUpload\DTO\UploadResult\getMimeType(), ILIAS\FileUpload\DTO\UploadResult\getName(), ILIAS\FileUpload\DTO\UploadResult\getSize(), and ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
|
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 179 of file FileUploadImpl.php.
References $path, ILIAS\FileUpload\DTO\UploadResult\getMetaData(), ILIAS\FileUpload\DTO\UploadResult\getMimeType(), ILIAS\FileUpload\DTO\UploadResult\getName(), ILIAS\FileUpload\DTO\UploadResult\getSize(), and ILIAS\FileUpload\DTO\UploadResult\getStatus().
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), and ILIAS\FileUpload\FileUploadImpl\moveOneFileTo().
ILIAS\FileUpload\FileUploadImpl::register | ( | PreProcessor | $preProcessor | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 251 of file FileUploadImpl.php.
|
private |
Reject a failed upload with the given metadata.
Metadata | $metadata | The metadata used to create the rejected result. |
Definition at line 320 of file FileUploadImpl.php.
References ILIAS\FileUpload\DTO\Metadata\getFilename(), ILIAS\FileUpload\DTO\Metadata\getMimeType(), ILIAS\FileUpload\DTO\Metadata\getUploadSize(), and ILIAS\FileUpload\DTO\ProcessingStatus\REJECTED.
Referenced by ILIAS\FileUpload\FileUploadImpl\process().
|
private |
Selects the correct filesystem by the given Location constant.
int | $location | The storage location constant defined within the Location interface. |
Definition at line 222 of file FileUploadImpl.php.
References 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().
ILIAS\FileUpload\FileUploadImpl::uploadSizeLimit | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 242 of file FileUploadImpl.php.
References ilFileUtils\getUploadSizeLimitBytes().
|
private |
Definition at line 51 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 52 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 54 of file FileUploadImpl.php.
|
private |
Definition at line 53 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasBeenProcessed().
|
private |
Definition at line 50 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 62 of file FileUploadImpl.php.
|
private |
Definition at line 58 of file FileUploadImpl.php.
|
private |
Definition at line 66 of file FileUploadImpl.php.