74 : bool
75 {
76
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);
83
84
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);
89
90
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);
94
95
96 $file_size_job = $this->task_factory->createTask(ilCheckSumOfWorkspaceFileSizesJob::class, [$collect_job]);
97
98
99 $file_size_interaction = $this->task_factory->createTask(ilSumOfWorkspaceFileSizesTooLargeInteraction::class, [$file_size_job]);
100 $this->
logger->debug(
'Determined the sum of all file sizes');
101
102
103 $copy_job = $this->task_factory->createTask(ilCopyWorkspaceFilesToTempDirectoryJob::class, [$file_size_interaction]);
104
105
106 $zip_job = $this->task_factory->createTask(ilZipJob::class, [$copy_job]);
107 $this->
logger->debug(
'Moved files from source- to target-directory');
108
109
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());
114
115
116 $bucket->setTask($download_interaction);
118 $this->
logger->debug(
'Added last task to bucket and set the following title: ' . $this->
getBucketTitle());
119
120 $task_manager =
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
121 $task_manager->run($bucket);
122 $this->
logger->debug(
'Ran bucket in task manager');
123
124 return true;
125 }
static getASCIIFilename(string $a_filename)
Copy definition for workspace folders.