77 $this->
logger->info(
'Started download workspace files background task');
80 $bucket->setUserId($this->user_id);
81 $bucket->setTitle($normalized_name);
82 $this->
logger->debug(
'Created bucket and set the following user id: ' . $this->user_id);
86 $definition->setTempDir($normalized_name);
87 $definition->setObjectWspIds($this->object_wsp_ids);
88 $this->
logger->debug(
'Created copy definition and added the following tempdir: ' . $normalized_name);
91 $collect_job = $this->task_factory->createTask(ilCollectWorkspaceFilesJob::class, [$definition, $this->initiated_by_folder_action]);
92 $this->
logger->debug(
'Collected files based on the following object ids: ');
93 $this->
logger->dump($this->object_wsp_ids);
96 $file_size_job = $this->task_factory->createTask(ilCheckSumOfWorkspaceFileSizesJob::class, [$collect_job]);
99 $file_size_interaction = $this->task_factory->createTask(ilSumOfWorkspaceFileSizesTooLargeInteraction::class, [$file_size_job]);
100 $this->
logger->debug(
'Determined the sum of all file sizes');
103 $copy_job = $this->task_factory->createTask(ilCopyWorkspaceFilesToTempDirectoryJob::class, [$file_size_interaction]);
106 $zip_job = $this->task_factory->createTask(ilZipJob::class, [$copy_job]);
107 $this->
logger->debug(
'Moved files from source- to target-directory');
111 $download_name->setValue($normalized_name .
'.zip');
112 $download_interaction = $this->task_factory->createTask(ilDownloadZipInteraction::class, [$zip_job, $download_name]);
113 $this->
logger->debug(
'Created a download interaction with the following download name: ' . $download_name->getValue());
116 $bucket->setTask($download_interaction);
118 $this->
logger->debug(
'Added last task to bucket and set the following title: ' . $this->
getBucketTitle());
120 $task_manager =
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
121 $task_manager->run($bucket);
122 $this->
logger->debug(
'Ran bucket in task manager');
static getASCIIFilename(string $a_filename)
Copy definition for workspace folders.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']