32 $this->logger =
$GLOBALS[
'DIC']->logger()->cal();
54 return new SingleType(ilCopyDefinition::class);
73 $this->logger->debug(
'Start checking adherence to maxsize!');
74 $this->logger->dump($input);
75 $definition = $input[0];
76 $object_ref_ids = $definition->getObjectRefIds();
79 $size_limit = (int) $this->
settings->get(
"bgtask_download_limit", 0);
80 $size_limit_bytes = $size_limit * 1024 * 1024;
81 $this->logger->debug(
'Global limit (max sum of all file-sizes) in file-settings: ' . $size_limit_bytes .
' bytes');
85 $this->logger->debug(
'Calculated sum of all file-sizes: ' . $total_bytes .
'MB');
88 $adheres_to_limit->setValue(
true);
89 if ($total_bytes > $size_limit_bytes) {
90 $adheres_to_limit->setValue(
false);
93 $definition->setSumFileSizes($total_bytes);
94 $definition->setAdheresToLimit($adheres_to_limit);
110 $tree = $DIC[
'tree'];
112 include_once(
"./Modules/File/classes/class.ilObjFileAccess.php");
115 foreach ($a_ref_ids as $ref_id) {
124 $subtree = $tree->getChildsByTypeFilter($ref_id, array(
"fold",
"file"));
125 if (count($subtree) > 0) {
126 $child_ref_ids = array();
127 foreach ($subtree as $child) {
128 $child_ref_ids[] = $child[
"ref_id"];
152 $ilAccess = $DIC[
'ilAccess'];
154 if (!$ilAccess->checkAccess(
"read",
"", $ref_id)) {
Description of class class.
Class ChatMainBarProvider .
static _isInTrash($a_ref_id)
checks wether object is in trash
run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
static _lookupFileSize($a_id)
static _lookupObjId($a_id)
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
validateAccess($ref_id)
Check file access.
static _lookupType($a_id, $a_reference=false)
lookup object type
calculateRecursive($a_ref_ids, &$a_file_size)
Calculates the number and size of the files being downloaded recursively.