Class ilDownloadContainerFilesBackgroundTask.
More...
◆ __construct()
ilDownloadContainerFilesBackgroundTask::__construct |
( |
int |
$a_usr_id, |
|
|
array |
$a_object_ref_ids, |
|
|
bool |
$a_initiated_by_folder_action |
|
) |
| |
◆ getBucketTitle()
ilDownloadContainerFilesBackgroundTask::getBucketTitle |
( |
| ) |
|
◆ run()
ilDownloadContainerFilesBackgroundTask::run |
( |
| ) |
|
Definition at line 77 of file class.ilDownloadContainerFilesBackgroundTask.php.
References $GLOBALS, ilFileUtils\getASCIIFilename(), getBucketTitle(), and ILIAS\Repository\logger().
80 $this->
logger->info(
'Started download container files background task');
82 $bucket->setUserId($this->user_id);
83 $this->
logger->debug(
'Created bucket and set the following user id: ' . $this->user_id);
88 $definition->setTempDir($normalized_name);
89 $definition->setObjectRefIds($this->object_ref_ids);
90 $this->
logger->debug(
'Created copy definition and added the following tempdir: ' . $normalized_name);
93 $collect_job = $this->task_factory->createTask(ilCollectFilesJob::class, [$definition, $this->initiated_by_folder_action]);
94 $this->
logger->debug(
'Collected files based on the following object ids: ');
95 $this->
logger->dump($this->object_ref_ids);
98 $file_size_job = $this->task_factory->createTask(ilCheckSumOfFileSizesJob::class, [$collect_job]);
101 $file_size_interaction = $this->task_factory->createTask(ilSumOfFileSizesTooLargeInteraction::class, [$file_size_job]);
102 $this->
logger->debug(
'Determined the sum of all file sizes');
105 $copy_job = $this->task_factory->createTask(ilCopyFilesToTempDirectoryJob::class, [$file_size_interaction]);
108 $zip_job = $this->task_factory->createTask(ilZipJob::class, [$copy_job]);
109 $this->
logger->debug(
'Moved files from source- to target-directory');
113 $download_name->setValue($normalized_name .
'.zip');
114 $download_interaction = $this->task_factory->createTask(ilDownloadZipInteraction::class, [$zip_job, $download_name]);
115 $this->
logger->debug(
'Created a download interaction with the following download name: ' . $download_name->getValue());
118 $bucket->setTask($download_interaction);
120 $this->
logger->debug(
'Added last task to bucket and set the following title: ' . $this->
getBucketTitle());
122 $task_manager =
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
123 $task_manager->run($bucket);
124 $this->
logger->debug(
'Ran bucket in task manager');
static getASCIIFilename(string $a_filename)
Description of class class.
◆ setBucketTitle()
ilDownloadContainerFilesBackgroundTask::setBucketTitle |
( |
string |
$a_title | ) |
|
◆ $bucket_title
string ilDownloadContainerFilesBackgroundTask::$bucket_title |
|
protected |
◆ $has_files
bool ilDownloadContainerFilesBackgroundTask::$has_files = false |
|
protected |
◆ $initiated_by_folder_action
bool ilDownloadContainerFilesBackgroundTask::$initiated_by_folder_action = false |
|
protected |
◆ $lng
ilLanguage ilDownloadContainerFilesBackgroundTask::$lng |
|
protected |
◆ $logger
ilLogger ilDownloadContainerFilesBackgroundTask::$logger |
|
private |
◆ $object_ref_ids
array ilDownloadContainerFilesBackgroundTask::$object_ref_ids |
|
protected |
◆ $task_factory
◆ $user_id
int ilDownloadContainerFilesBackgroundTask::$user_id |
|
protected |
The documentation for this class was generated from the following file: