ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCalendarZipJob.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27
33{
35
39 public function __construct()
40 {
41 global $DIC;
42
43 $this->logger = $DIC->logger()->cal();
44 }
45
49 public function getInputTypes(): array
50 {
51 return
52 [
53 new SingleType(StringValue::class)
54 ];
55 }
56
60 public function getOutputType(): Type
61 {
62 return new SingleType(StringValue::class);
63 }
64
68 public function isStateless(): bool
69 {
70 return true;
71 }
72
77 public function run(array $input, Observer $observer): Value
78 {
79 $this->logger->debug('Start zipping input dir!');
80 $tmpdir = $input[0]->getValue();
81 $this->logger->debug('Zipping directory:' . $tmpdir);
82
83 ilFileUtils::zip($tmpdir, $tmpdir . '.zip');
84
85 // delete temp directory
86 ilFileUtils::delDir($tmpdir);
87
88 $zip_file_name = new StringValue();
89 $zip_file_name->setValue($tmpdir . '.zip');
90 return $zip_file_name;
91 }
92
97 {
98 return 30;
99 }
100}
Description of class class.
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
run(array $input, Observer $observer)
@inheritDoc
static zip(string $a_dir, string $a_file, bool $compress_content=false)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Component logger with individual log levels by component id.
global $DIC
Definition: shib_login.php:26