42 $this->
logger = $DIC->logger()->cal();
64 return new SingleType(ilCopyDefinition::class);
83 $this->
logger->debug(
'Start checking adherence to maxsize!');
84 $this->
logger->dump($input);
85 $definition = $input[0];
86 $object_ref_ids = $definition->getObjectRefIds();
89 $size_limit = (
int) $this->
settings->get(
"bgtask_download_limit",
'0');
90 $size_limit_bytes = $size_limit * 1024 * 1024;
91 $this->
logger->debug(
'Global limit (max sum of all file-sizes) in file-settings: ' . $size_limit_bytes .
' bytes');
95 $this->
logger->debug(
'Calculated sum of all file-sizes: ' . $total_bytes .
'MB');
98 $adheres_to_limit->setValue(
true);
99 if ($total_bytes > $size_limit_bytes) {
100 $adheres_to_limit->setValue(
false);
103 $definition->setSumFileSizes($total_bytes);
104 $definition->setAdheresToLimit($adheres_to_limit);
117 $tree = $DIC[
'tree'];
120 foreach ($a_ref_ids as
$ref_id) {
129 $subtree = $tree->getChildsByTypeFilter($ref_id, array(
"fold",
"file"));
130 if (count($subtree) > 0) {
131 $child_ref_ids = array();
132 foreach ($subtree as $child) {
133 $child_ref_ids[] = $child[
"ref_id"];
155 $ilAccess = $DIC[
'ilAccess'];
157 if (!$ilAccess->checkAccess(
"read",
"", $ref_id)) {
Description of class class.
Class ChatMainBarProvider .
run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
static _lookupFileSize(int $a_id, bool $by_reference=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _isInTrash(int $ref_id)
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
calculateRecursive(array $a_ref_ids, int &$a_file_size)
Calculates the number and size of the files being downloaded recursively.
static _lookupType(int $id, bool $reference=false)
validateAccess(int $ref_id)
Check file access.