ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Class FileUploadImpl. More...
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 UploadResult to the given destination.
| ||||||||||||||||
moveFilesTo ($destination, $location=Location::STORAGE) | ||||||||||||||||
uploadSizeLimit () | ||||||||||||||||
register (PreProcessor $preProcessor) | ||||||||||||||||
getResults () | ||||||||||||||||
hasUploads () | ||||||||||||||||
hasBeenProcessed () | ||||||||||||||||
Public Member Functions inherited from ILIAS\FileUpload\FileUpload | ||||||||||||||||
process () | ||||||||||||||||
Invokes all preprocessors for each uploaded file in the sequence they got registered. More... | ||||||||||||||||
Protected Member Functions | |
flattenUploadedFiles ($uploadedFiles) | |
Private Member Functions | |
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 75 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$filesystems, ILIAS\FileUpload\FileUploadImpl\$globalHttpState, ILIAS\FileUpload\FileUploadImpl\$processorManager, and ILIAS\Filesystem\filesystems().
|
protected |
array | $uploadedFiles |
Definition at line 351 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasUploads(), and ILIAS\FileUpload\FileUploadImpl\register().
ILIAS\FileUpload\FileUploadImpl::getResults | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 321 of file FileUploadImpl.php.
ILIAS\FileUpload\FileUploadImpl::hasBeenProcessed | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 368 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\$processed.
ILIAS\FileUpload\FileUploadImpl::hasUploads | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 334 of file FileUploadImpl.php.
References ILIAS\FileUpload\FileUploadImpl\flattenUploadedFiles().
ILIAS\FileUpload\FileUploadImpl::moveFilesTo | ( | $destination, | |
$location = Location::STORAGE |
|||
) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 117 of file FileUploadImpl.php.
References $destination, $key, $location, $path, 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().
ILIAS\FileUpload\FileUploadImpl::moveOneFileTo | ( | UploadResult | $uploadResult, |
$destination, | |||
$location = Location::STORAGE , |
|||
$file_name = '' , |
|||
$override_existing = false |
|||
) |
Moves a single UploadResult to the given destination.
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 89 of file FileUploadImpl.php.
References $destination, $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().
|
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 179 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 158 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 232 of file FileUploadImpl.php.
References $file, $metadata, $result, GuzzleHttp\Psr7\$stream, ILIAS\FileUpload\FileUploadImpl\flattenUploadedFiles(), ILIAS\Filesystem\Stream\Streams\ofPsr7Stream(), ILIAS\FileUpload\FileUpload\process(), and ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload().
|
private |
Reject a failed upload with the given metadata.
UploadedFileInterface | $file | |
Metadata | $metadata | The metadata used to create the rejected result. |
Definition at line 300 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.
Referenced by ILIAS\FileUpload\FileUploadImpl\register().
|
private |
Selects the correct filesystem by the given Location constant.
int | $location | The storage location constant defined within the Location interface. |
Definition at line 203 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().
ILIAS\FileUpload\FileUploadImpl::uploadSizeLimit | ( | ) |
Implements ILIAS\FileUpload\FileUpload.
Definition at line 223 of file FileUploadImpl.php.
|
private |
Definition at line 39 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 43 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 51 of file FileUploadImpl.php.
|
private |
Definition at line 47 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\hasBeenProcessed().
|
private |
Definition at line 35 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\__construct().
|
private |
Definition at line 59 of file FileUploadImpl.php.
|
private |
Definition at line 55 of file FileUploadImpl.php.
Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo().
|
private |
Definition at line 63 of file FileUploadImpl.php.