ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
Agent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\Questions\Question\Persistence\TableDefinitions as QuestionTableDefinitions;
26use ILIAS\Questions\Persistence\Factory as PersistenceFactory;
31use ILIAS\Setup\Agent\HasNoNamedObjective;
37
38class Agent implements SetupAgent
39{
40 use HasNoNamedObjective;
41
46 public function __construct(
47 private readonly PersistenceFactory $persistence_factory,
48 private readonly TableNameBuilder $question_table_names_builder,
49 private readonly array $answer_form_migrations,
50 private readonly array $capability_migrations
51 ) {
52 }
53
54 public function hasConfig(): bool
55 {
56 return false;
57 }
58
60 {
61 throw new \LogicException(self::class . ' has no Config.');
62 }
63
64 #[\Override]
65 public function getUpdateObjective(
66 ?Config $config = null
67 ): Objective {
69 'Database is updated for ILIAS\Questions',
70 false,
73 $this->question_table_names_builder
74 )
75 ),
80 'ILIAS',
81 'cloze'
82 )
83 ),
84 new ClozeTableDefinitions(
85 $this->persistence_factory,
87 'ILIAS',
88 'cloze'
89 )
90 )
91 )
92 ),
94 new TempTables()
95 ),
97 'qsts',
98 'Questions'
99 )
100 );
101 }
102
103 #[\Override]
104 public function getStatusObjective(
105 Storage $storage
106 ): Objective {
108 'ILIAS\Questions',
109 true,
111 $storage,
113 $this->question_table_names_builder
114 )
115 ),
117 $storage,
121 'ILIAS',
122 'cloze'
123 )
124 ),
125 new ClozeTableDefinitions(
126 $this->persistence_factory,
128 'ILIAS',
129 'cloze'
130 )
131 )
132 )
133 )
134 );
135 }
136
137 #[\Override]
138 public function getMigrations(): array
139 {
140 return [
142 $this->persistence_factory,
143 $this->question_table_names_builder,
144 new QuestionTableDefinitions(
145 $this->persistence_factory
146 ),
148 $this->persistence_factory
149 ),
150 $this->answer_form_migrations,
151 $this->capability_migrations
152 )
153 ];
154 }
155
156 #[\Override]
157 public function getBuildObjective(): Objective
158 {
159 return new NullObjective();
160 }
161
162 #[\Override]
163 public function getInstallObjective(
164 ?Config $config = null
165 ): Objective {
166 return new NullObjective();
167 }
168}
hasConfig()
Does this agent require a configuration?
Definition: Agent.php:54
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
Definition: Agent.php:157
getUpdateObjective(?Config $config=null)
Get the goal the agent wants to achieve on update.
Definition: Agent.php:65
getStatusObjective(Storage $storage)
Definition: Agent.php:104
__construct(private readonly PersistenceFactory $persistence_factory, private readonly TableNameBuilder $question_table_names_builder, private readonly array $answer_form_migrations, private readonly array $capability_migrations)
Definition: Agent.php:46
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
Definition: Agent.php:59
getMigrations()
Get a named map of migrations available for this Agent.
Definition: Agent.php:138
getInstallObjective(?Config $config=null)
Get the goals the agent wants to achieve on setup.
Definition: Agent.php:163
A objective collection is a objective that is achieved once all subobjectives are achieved.
A non-objective, nothing to do to achieve it...
This class attempt to achieve a set of database update steps.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'vtt', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.
A configuration for the setup.
Definition: Config.php:27
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31