ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCalendarZipJob.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
7
15{
16 private $logger = null;
17
18
22 public function __construct()
23 {
24 $this->logger = $GLOBALS['DIC']->logger()->cal();
25 }
26
30 public function getInputTypes()
31 {
32 return
33 [
34 new SingleType(StringValue::class)
35 ];
36 }
37
41 public function getOutputType()
42 {
43 return new SingleType(StringValue::class);
44 }
45
49 public function isStateless()
50 {
51 return true;
52 }
53
58 public function run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
59 {
60 $this->logger->debug('Start zipping input dir!');
61 $this->logger->dump($input);
62 $tmpdir = $input[0]->getValue();
63 $this->logger->debug('Zipping directory:' . $tmpdir);
64
65 ilUtil::zip($tmpdir, $tmpdir . '.zip');
66
67 // delete temp directory
68 ilUtil::delDir($tmpdir);
69
70 $zip_file_name = new StringValue();
71 $zip_file_name->setValue($tmpdir . '.zip');
72 return $zip_file_name;
73 }
74
79 {
80 return 30;
81 }
82}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
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, \ILIAS\BackgroundTasks\Observer $observer)
@inheritDoc
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Class ChatMainBarProvider \MainMenu\Provider.