ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ILIAS\File\Sanitation\SanitationReportJob Class Reference

Class SanitationReportJob. More...

+ Inheritance diagram for ILIAS\File\Sanitation\SanitationReportJob:
+ Collaboration diagram for ILIAS\File\Sanitation\SanitationReportJob:

Public Member Functions

 run (array $input, Observer $observer)
 
 isStateless ()
 
 getExpectedTimeOfTaskInSeconds ()
 
 getInputTypes ()
 
 getOutputType ()
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractJob
 getInput ()
 
Returns
mixed returns the input array
More...
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 setInput (array $values)
 
 getOutput ()
 
 getInput ()
 
 getType ()
 
 unfoldTask ()
 Unfold the task. More...
 
 getRemoveOption ()
 
Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();
More...
 
 getAbortOption ()
 
Returns
Option In case a Job is failed or did not respond for some time, an Abort-Option is displayed. There is already a Standard-Abort-Option registered, you can override with your own and do some cleanup if possible.
More...
 

Additional Inherited Members

- Data Fields inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
const MAIN_REMOVE = 'bt_main_remove'
 
const MAIN_ABORT = 'bt_main_abort'
 
- Protected Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 checkTypes ($values)
 
 extractType ($value)
 
- Protected Attributes inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 $input = []
 
 $output
 

Detailed Description

Member Function Documentation

◆ getExpectedTimeOfTaskInSeconds()

ILIAS\File\Sanitation\SanitationReportJob::getExpectedTimeOfTaskInSeconds ( )
Returns
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount of data, try to set a possible high value of try to calculate it. If a task duration exceeds this value, it will be displayed as "possibly failed" to the user

Implements ILIAS\BackgroundTasks\Task\Job.

Definition at line 49 of file SanitationReportJob.php.

50  {
51  return 3600;
52  }

◆ getInputTypes()

ILIAS\File\Sanitation\SanitationReportJob::getInputTypes ( )
Returns
Type[] A list of types that are taken as input.

Implements ILIAS\BackgroundTasks\Task.

Definition at line 55 of file SanitationReportJob.php.

56  {
57  return array();
58  }

◆ getOutputType()

ILIAS\File\Sanitation\SanitationReportJob::getOutputType ( )
Returns
Type A single type.

Implements ILIAS\BackgroundTasks\Task.

Definition at line 61 of file SanitationReportJob.php.

62  {
63  return new ListType(IntegerValue::class);
64  }

◆ isStateless()

ILIAS\File\Sanitation\SanitationReportJob::isStateless ( )
Returns
bool returns true iff the job's output ONLY depends on the input. Stateless task results may be cached!

Implements ILIAS\BackgroundTasks\Task\Job.

Definition at line 43 of file SanitationReportJob.php.

44  {
45  return false;
46  }

◆ run()

ILIAS\File\Sanitation\SanitationReportJob::run ( array  $input,
Observer  $observer 
)
Parameters

Implements ILIAS\BackgroundTasks\Task\Job.

Definition at line 19 of file SanitationReportJob.php.

References $data, $DIC, $list, and $s.

20  {
21  global $DIC;
22 
23  $q = "SELECT * FROM object_data WHERE type='file'";
24  $s = $DIC->database()->query($q);
25 
26  $files_ids = [];
27 
28  while ($data = $DIC->database()->fetchObject($s)) {
29  $file_object = new ilObjFile($data->obj_id, false);
30  $san = new FilePathSanitizer($file_object);
31  if ($san->needsSanitation()) {
32  $files_ids[] = (int) $data->obj_id;
33  }
34  }
35 
36  $list = new ListValue();
37  $list->setValue($files_ids);
38 
39  return $list;
40  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
$s
Definition: pwgen.php:45
$data
Definition: bench.php:6

The documentation for this class was generated from the following file: