43 $this->
logger = $DIC->logger()->cal();
65 return new SingleType(ilCopyDefinition::class);
84 $this->
logger->debug(
'Start checking adherence to maxsize!');
85 $this->
logger->dump($input);
86 $definition = $input[0];
87 $object_ref_ids = $definition->getObjectRefIds();
91 $size_limit =
$general->getDownloadLimitinMB();
92 $size_limit_bytes = $size_limit * 1024 * 1024;
93 $this->
logger->debug(
'Global limit (max sum of all file-sizes) in file-settings: ' . $size_limit_bytes .
' bytes');
97 $this->
logger->debug(
'Calculated sum of all file-sizes: ' . $total_bytes .
'MB');
100 $adheres_to_limit->setValue(
true);
101 if ($total_bytes > $size_limit_bytes) {
102 $adheres_to_limit->setValue(
false);
105 $definition->setSumFileSizes($total_bytes);
106 $definition->setAdheresToLimit($adheres_to_limit);
119 $tree = $DIC[
'tree'];
122 foreach ($a_ref_ids as
$ref_id) {
131 $subtree = $tree->getChildsByTypeFilter($ref_id, array(
"fold",
"file"));
132 if (count($subtree) > 0) {
133 $child_ref_ids = array();
134 foreach ($subtree as $child) {
135 $child_ref_ids[] = $child[
"ref_id"];
157 $ilAccess = $DIC[
'ilAccess'];
159 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.