19 declare(strict_types=1);
50 $this->irss = $DIC->resourceStorage();
51 $this->
logger = $DIC->logger()->cal();
61 new SingleType(ilCalendarRessourceStorageCopyDefinition::class)
87 $cal_copy_def = $input[0];
89 $this->
logger->info(
'Called copy files job');
91 $this->target_directory = $cal_copy_def->getTempDir();
100 $this->
copyFiles($targetdir, $cal_copy_def);
105 $this->
logger->debug(
'Returning new tempdirectory: ' . $targetdir);
108 $out->setValue($targetdir);
121 $this->
logger->info(
'New temp directory: ' . $tmpdir);
129 $this->
logger->info(
'New final directory: ' . $final_dir);
151 $resource_identification = $this->irss->manage()->find($rid);
153 if(is_null($resource_identification)) {
154 $this->
logger->notice(
'Cannot ressource identification of rid: ' . $rid);
158 $this->
logger->debug(
'Creating directory: ' . $tmpdir .
'/' . dirname($target_dir));
160 $this->
logger->debug(
'Copying ressource with id: ' . $rid .
' to ' . $tmpdir .
'/' . $target_dir);
164 $this->irss->consume()->stream($resource_identification)->getStream()
173 if (!file_exists($absolute_path)) {
174 $this->
logger->notice(
'Cannot find file: ' . $absolute_path);
178 $this->
logger->debug(
'Creating directory: ' . $tmpdir .
'/' . dirname($target_dir));
180 $this->
logger->debug(
'Copying from: ' . $absolute_path .
' to ' . $tmpdir .
'/' . $target_dir);
182 copy($absolute_path, $tmpdir .
'/' . $target_dir);
run(array $input, Observer $observer)
ILIAS ResourceStorage Services $irss
createTargetDirectory(string $a_tmpdir)
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
createUniqueTempDirectory()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
copyWithRId(string $tmpdir, array $copy_task)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCopyDefinitions()
Get copy definitions.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
Description of class class.
copyWithAbsolutePath(string $tmpdir, array $copy_task)
copyFiles(string $tmpdir, ilCalendarRessourceStorageCopyDefinition $definition)
Copy files.
__construct()
Constructor.