ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSubmissionsZipJob.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 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()->exc();
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  $tmpdir = $input[0]->getValue();
61 
62  ilUtil::zip($tmpdir, $tmpdir . '.zip');
63 
64  // delete temp directory
65  ilUtil::delDir($tmpdir);
66 
67  $zip_file_name = new StringValue();
68  $zip_file_name->setValue($tmpdir . '.zip');
69  return $zip_file_name;
70  }
71 
76  {
77  return 30;
78  }
79 }
Class BaseForm.
run(array $input, \ILIAS\BackgroundTasks\Observer $observer)
Description of class class.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.