4include_once
"Services/BackgroundTask/interfaces/interface.ilBackgroundTaskHandler.php";
44 $this->filename = $a_value;
64 $this->task = $a_task;
79 $this->log->debug(
"start");
88 if ($this->task->isToBeCancelled()) {
94 $this->task->setCurrentStep(++$current_step);
103 if ($this->task->isToBeCancelled()) {
109 $this->log->debug(
"end");
119 $this->log->debug(
"");
138 $ilCtrl->setParameterByClass(
"ilbackgroundtaskhub",
"tid", $this->task->getId());
139 $url =
$ilCtrl->getLinkTargetByClass(
"ilbackgroundtaskhub",
"deliver",
"",
false,
false);
141 return array(
"redirect",
$url);
162 $this->task->delete();
189 if (is_dir($tmp_folder)) {
191 $successful = !file_exists($tmp_folder);
197 if (file_exists($tmp_file)) {
198 $successful = @unlink($tmp_file);
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
static getDataDir()
get data directory (outside webspace)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
Background task handler for zip creation.
deleteTaskAndFiles()
Remove task and its files.
setDeliveryFilename($a_value)
Sets the delivery file name.
__construct()
Constructor.
getTempZipFilePath()
Gets the full path of the temporary zip file that gets created.
getTask()
Get current task instance.
process()
Process the task.
getTempBasePath()
Gets the temporary base path for all files and folders related to this download.
setTask(ilBackgroundTask $a_task)
Set current task instance.
getDeliveryFilename()
Gets the delivery file name.
deleteTempFiles($a_delete_zip=true)
Deletes the temporary files and folders belonging to this download.
gatherFiles()
Copy files to target directory.
getTempFolderPath()
Gets the temporary folder path to copy the files and folders to.
Background task handler interface.