Background task for downloads.
More...
◆ __construct()
| ilDownloadWorkspaceFolderBackgroundTask::__construct |
( |
int |
$a_usr_id, |
|
|
array |
$a_object_wsp_ids, |
|
|
bool |
$a_initiated_by_folder_action = false |
|
) |
| |
◆ getBucketTitle()
| ilDownloadWorkspaceFolderBackgroundTask::getBucketTitle |
( |
| ) |
|
◆ run()
| ilDownloadWorkspaceFolderBackgroundTask::run |
( |
| ) |
|
Definition at line 74 of file class.ilDownloadWorkspaceFolderBackgroundTask.php.
References $GLOBALS, ilFileUtils\getASCIIFilename(), getBucketTitle(), and ILIAS\Repository\logger().
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.
◆ setBucketTitle()
| ilDownloadWorkspaceFolderBackgroundTask::setBucketTitle |
( |
string |
$a_title | ) |
|
◆ $bucket_title
| string ilDownloadWorkspaceFolderBackgroundTask::$bucket_title |
|
protected |
◆ $has_files
| bool ilDownloadWorkspaceFolderBackgroundTask::$has_files = false |
|
protected |
◆ $initiated_by_folder_action
| bool ilDownloadWorkspaceFolderBackgroundTask::$initiated_by_folder_action = false |
|
protected |
◆ $lng
| ilLanguage ilDownloadWorkspaceFolderBackgroundTask::$lng |
|
protected |
◆ $logger
| ilLogger ilDownloadWorkspaceFolderBackgroundTask::$logger = null |
|
private |
◆ $object_wsp_ids
| array ilDownloadWorkspaceFolderBackgroundTask::$object_wsp_ids |
|
protected |
◆ $task_factory
| ILIAS BackgroundTasks Task TaskFactory ilDownloadWorkspaceFolderBackgroundTask::$task_factory = null |
|
protected |
◆ $user_id
| int ilDownloadWorkspaceFolderBackgroundTask::$user_id |
|
protected |
The documentation for this class was generated from the following file: