ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMediaObjectSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
5 use ILIAS\Setup;
7 use ILIAS\Data;
8 use ILIAS\UI;
9 
10 class ilMediaObjectSetupAgent implements Setup\Agent
11 {
13 
17  protected $refinery;
18 
19  public function __construct(
21  ) {
22  $this->refinery = $refinery;
23  }
24 
28  public function hasConfig() : bool
29  {
30  return true;
31  }
32 
37  {
38  return $this->refinery->custom()->transformation(function ($data) {
39  return new \ilMediaObjectSetupConfig(
40  $data["path_to_ffmpeg"] ?? null
41  );
42  });
43  }
44 
48  public function getInstallObjective(Setup\Config $config = null) : Setup\Objective
49  {
51  'mobs',
53  );
54 
55  return new Setup\ObjectiveCollection(
56  "Complete objectives from Services/MediaObject",
57  false,
59  $dir_objective
60  );
61  }
62 
66  public function getUpdateObjective(Setup\Config $config = null) : Setup\Objective
67  {
68  if ($config !== null) {
70  }
71  return new Setup\Objective\NullObjective();
72  }
73 
77  public function getBuildArtifactObjective() : Setup\Objective
78  {
79  return new Setup\Objective\NullObjective();
80  }
81 
85  public function getStatusObjective(Setup\Metrics\Storage $storage) : Setup\Objective
86  {
87  return new ilMediaObjectMetricsCollectedObjective($storage);
88  }
89 
93  public function getMigrations() : array
94  {
95  return [];
96  }
97 }
$data
Definition: storeScorm.php:23
getStatusObjective(Setup\Metrics\Storage $storage)
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:14
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Stores configuration for the service (currently only path to ffmpeg) in the according ini-field...
getUpdateObjective(Setup\Config $config=null)
Builds data types.
Definition: Factory.php:19
getInstallObjective(Setup\Config $config=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Refinery\Factory $refinery)
A transformation is a function from one datatype to another.
A configuration for the setup.
Definition: Config.php:10