53 new SingleType(ilWorkspaceCopyDefinition::class),
59 return new SingleType(ilWorkspaceCopyDefinition::class);
69 $this->
logger->debug(
'Start checking adherence to maxsize!');
70 $this->
logger->dump($input);
71 $definition = $input[0];
72 $object_wps_ids = $definition->getObjectWspIds();
76 $size_limit =
$general->getDownloadLimitinMB();
77 $size_limit_bytes = $size_limit * 1024 * 1024;
78 $this->
logger->debug(
'Global limit (max sum of all file-sizes) in file-settings: ' . $size_limit_bytes .
' bytes');
82 $this->
logger->debug(
'Calculated sum of all file-sizes: ' . $total_bytes .
' B');
85 $adheres_to_limit->setValue(
true);
86 if ($total_bytes > $size_limit_bytes) {
87 $adheres_to_limit->setValue(
false);
90 $definition->setSumFileSizes($total_bytes);
91 $definition->setAdheresToLimit($adheres_to_limit);
101 array $object_wps_ids,
105 $tree = $DIC[
'tree'];
108 foreach ($object_wps_ids as $object_wps_id) {
120 if (count($subtree) > 0) {
121 $child_wsp_ids = array();
122 foreach ($subtree as $child) {
123 $child_wsp_ids[] = $child[
"child"];
140 if (!$ilAccess->checkAccess(
"read",
"", $wsp_id)) {
static getLogger(string $a_component_id)
Get component logger.
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupFileSize(int $a_id, bool $by_reference=true)
Description of class class.
getExpectedTimeOfTaskInSeconds()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
calculateRecursive(array $object_wps_ids, int &$a_file_size)
Calculates the number and size of the files being downloaded recursively.
getChildsByTypeFilter(int $a_node_id, array $a_types, string $a_order="", string $a_direction="ASC")
get child nodes of given node by object type
validateAccess(int $wsp_id)
lookupObjectId(int $a_node_id)
Get object id for node id.
static _lookupType(int $id, bool $reference=false)