ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Background task handler for folder downloads. More...
Public Member Functions | |
__construct () | |
Constructor. More... | |
getRefIds () | |
Gets the involved reference ids. More... | |
setRefIds ($a_val) | |
Sets the involved reference ids. More... | |
init ($a_params=null) | |
Init background task. More... | |
Public Member Functions inherited from ilZipBackgroundTaskHandler | |
__construct () | |
Constructor. More... | |
setDeliveryFilename ($a_value) | |
Sets the delivery file name. More... | |
getDeliveryFilename () | |
Gets the delivery file name. More... | |
getTask () | |
Get current task instance. More... | |
process () | |
Process the task. More... | |
cancel () | |
Cancel download. More... | |
finish () | |
Finish download. More... | |
deliver () | |
Deliver file. More... | |
deleteTaskAndFiles () | |
Remove task and its files. More... | |
Static Public Member Functions | |
static | getInstanceFromTask (ilBackgroundTask $a_task) |
Constructor/Factory. More... | |
static | isActive () |
Is folder background download active? More... | |
static | getObjectListAction ($a_ref_id) |
Get object list action. More... | |
static | initObjectListAction () |
init js for background download More... | |
Protected Member Functions | |
gatherFiles () | |
calculateRecursive ($a_ref_ids, &$a_file_count, &$a_file_size) | |
Calculates the number and size of the files being downloaded recursively. More... | |
recurseFolder ($a_ref_id, $a_title, $a_tmpdir, &$a_current_step) | |
Copies a folder and its files to the specified temporary directory. More... | |
copyFile ($a_obj_id, $a_title, $a_tmpdir, &$a_current_step) | |
Copies a file to the specified temporary directory. More... | |
validateAccess ($ref_id) | |
Check file access. More... | |
getDownloadSizeLimit () | |
Get overall download size limit. More... | |
getFileCountThreshold () | |
Get file count threshold. More... | |
getTotalSizeThreshold () | |
Get total size threshold. More... | |
Protected Member Functions inherited from ilZipBackgroundTaskHandler | |
setTask (ilBackgroundTask $a_task) | |
Set current task instance. More... | |
gatherFiles () | |
Copy files to target directory. More... | |
deleteTempFiles ($a_delete_zip=true) | |
Deletes the temporary files and folders belonging to this download. More... | |
getTempFolderPath () | |
Gets the temporary folder path to copy the files and folders to. More... | |
getTempZipFilePath () | |
Gets the full path of the temporary zip file that gets created. More... | |
getTempBasePath () | |
Gets the temporary base path for all files and folders related to this download. More... | |
Protected Attributes | |
$settings | |
$ref_ids = array() | |
Protected Attributes inherited from ilZipBackgroundTaskHandler | |
$task | |
$filename | |
Static Protected Attributes | |
static | $initialized |
Static Private Member Functions | |
static | renameDuplicateFile ($duplicate_filename) |
bugfix mantis 24309: add a number in round brackets to the filename (in front of the file-type-extension) if there are identically named files in the same folder to prevent an exception being thrown More... | |
Static Private Attributes | |
static | $duplicate_files = array() |
Background task handler for folder downloads.
Definition at line 12 of file class.ilFolderDownloadBackgroundTaskHandler.php.
ilFolderDownloadBackgroundTaskHandler::__construct | ( | ) |
Constructor.
Definition at line 31 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References settings().
|
protected |
Calculates the number and size of the files being downloaded recursively.
array | $a_ref_ids | |
int | &$a_file_count | |
int | &$a_file_size |
Definition at line 256 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, ilObjFileAccess\_lookupFileSize(), ilObject\_lookupObjId(), ilObject\_lookupType(), array, and validateAccess().
Referenced by init().
|
protected |
Copies a file to the specified temporary directory.
int | $a_obj_id | |
string | $a_title | |
string | $a_tmpdir | |
int | &$a_current_step |
Definition at line 338 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References ilObjFile\_lookupAbsolutePath(), ilUtil\getASCIIFilename(), and renameDuplicateFile().
Referenced by gatherFiles(), and recurseFolder().
|
protected |
Definition at line 212 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References copyFile(), ilObjectFactory\getInstanceByRefId(), getRefIds(), ilZipBackgroundTaskHandler\getTempFolderPath(), recurseFolder(), and validateAccess().
|
protected |
Get overall download size limit.
Definition at line 438 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References settings().
Referenced by init().
|
protected |
Get file count threshold.
Definition at line 448 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References settings().
Referenced by init().
|
static |
Constructor/Factory.
ilBackgroundTask | $a_task |
Implements ilBackgroundTaskHandler.
Definition at line 37 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, $params, ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ilBackgroundTask\getParams().
|
static |
Get object list action.
int | $a_ref_id |
Definition at line 104 of file class.ilFolderDownloadBackgroundTaskHandler.php.
Referenced by ilObjectListGUI\insertCommand().
ilFolderDownloadBackgroundTaskHandler::getRefIds | ( | ) |
Gets the involved reference ids.
Definition at line 77 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $ref_ids.
Referenced by gatherFiles(), and init().
|
protected |
Get total size threshold.
Definition at line 458 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References settings().
Referenced by init().
ilFolderDownloadBackgroundTaskHandler::init | ( | $a_params = null | ) |
Init background task.
mixed | $a_params |
Implements ilBackgroundTaskHandler.
Definition at line 141 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, $ilUser, $lng, $res, ilZipBackgroundTaskHandler\$task, array, calculateRecursive(), ilZipBackgroundTaskHandler\finish(), ilUtil\formatSize(), ilBackgroundTask\getActiveByUserId(), ilBackgroundTaskJson\getBlockedJson(), getDownloadSizeLimit(), ilBackgroundTaskJson\getFailedJson(), getFileCountThreshold(), ilBackgroundTaskJson\getFinishedJson(), ilBackgroundTaskJson\getProcessingJson(), getRefIds(), getTotalSizeThreshold(), ilZipBackgroundTaskHandler\process(), setRefIds(), ilZipBackgroundTaskHandler\setTask(), ilBackgroundTask\STATUS_FINISHED, and ilBackgroundTask\STATUS_INITIALIZED.
|
static |
init js for background download
Definition at line 115 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, $ilCtrl, $tpl, $url, array, and ilModalGUI\initJS().
Referenced by ilContainerContentGUI\renderItem().
|
static |
Is folder background download active?
Definition at line 66 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $settings.
Referenced by ilObjectListGUI\insertCommand().
|
protected |
Copies a folder and its files to the specified temporary directory.
int | $a_ref_id | |
string | $a_title | |
string | $a_tmpdir | |
int | &$a_current_step |
Definition at line 299 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, array, copyFile(), ilUtil\getASCIIFilename(), ilUtil\makeDir(), and validateAccess().
Referenced by gatherFiles().
|
staticprivate |
bugfix mantis 24309: add a number in round brackets to the filename (in front of the file-type-extension) if there are identically named files in the same folder to prevent an exception being thrown
$duplicate_filename | string filename including path and extension |
Definition at line 372 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References ilZipBackgroundTaskHandler\$filename, and $path.
Referenced by copyFile().
ilFolderDownloadBackgroundTaskHandler::setRefIds | ( | $a_val | ) |
Sets the involved reference ids.
array | $a_val |
Definition at line 87 of file class.ilFolderDownloadBackgroundTaskHandler.php.
Referenced by init().
|
protected |
Check file access.
int | $ref_id |
Definition at line 412 of file class.ilFolderDownloadBackgroundTaskHandler.php.
References $DIC, and ilObject\_isInTrash().
Referenced by calculateRecursive(), gatherFiles(), and recurseFolder().
|
staticprivate |
Definition at line 17 of file class.ilFolderDownloadBackgroundTaskHandler.php.
|
staticprotected |
Definition at line 20 of file class.ilFolderDownloadBackgroundTaskHandler.php.
|
protected |
Definition at line 15 of file class.ilFolderDownloadBackgroundTaskHandler.php.
Referenced by getRefIds().
|
protected |
Definition at line 14 of file class.ilFolderDownloadBackgroundTaskHandler.php.
Referenced by isActive().