45 $this->
logger = $DIC->logger()->cal();
67 return new SingleType(ilCopyDefinition::class);
86 $this->
logger->debug(
'Start checking adherence to maxsize!');
87 $this->
logger->dump($input);
89 $object_ref_ids = $definition->getObjectRefIds();
93 $size_limit =
$general->getDownloadLimitinMB();
94 $size_limit_bytes = $size_limit * 1024 * 1024;
95 $this->
logger->debug(
'Global limit (max sum of all file-sizes) in file-settings: ' . $size_limit_bytes .
' bytes');
99 $this->
logger->debug(
'Calculated sum of all file-sizes: ' . $total_bytes .
'MB');
102 $adheres_to_limit->setValue(
true);
103 if ($total_bytes > $size_limit_bytes) {
104 $adheres_to_limit->setValue(
false);
107 $definition->setSumFileSizes($total_bytes);
108 $definition->setAdheresToLimit($adheres_to_limit);
121 $tree =
$DIC[
'tree'];
124 foreach ($a_ref_ids as
$ref_id) {
133 $subtree = $tree->getChildsByTypeFilter(
$ref_id, [
"fold",
"file"]);
134 if (count($subtree) > 0) {
136 foreach ($subtree as $child) {
137 $child_ref_ids[] = $child[
"ref_id"];
159 $ilAccess =
$DIC[
'ilAccess'];
161 if (!$ilAccess->checkAccess(
"read",
"",
$ref_id)) {
Description of class class.
readonly ilLogger $logger
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
getOutputType()
@inheritDoc
getInputTypes()
@inheritDoc
validateAccess(int $ref_id)
Check file access.
run(array $input, Observer $observer)
@inheritDoc
calculateRecursive(array $a_ref_ids, int &$a_file_size)
Calculates the number and size of the files being downloaded recursively.
Component logger with individual log levels by component id.
static _lookupFileSize(int $a_id, bool $by_reference=true)
static _lookupType(int $id, bool $reference=false)
static _isInTrash(int $ref_id)