ILIAS  release_8 Revision v8.24
Container.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\DI;
20
24
31class Container extends \Pimple\Container
32{
34
38 public function database(): \ilDBInterface
39 {
40 return $this["ilDB"];
41 }
42
46 public function rbac(): \ILIAS\DI\RBACServices
47 {
48 return new RBACServices($this);
49 }
50
54 public function ctrl(): \ilCtrlInterface
55 {
56 return $this["ilCtrl"];
57 }
58
62 public function user(): \ilObjUser
63 {
64 return $this["ilUser"];
65 }
66
70 public function access(): \ilAccessHandler
71 {
72 return $this["ilAccess"];
73 }
74
78 public function repositoryTree(): \ilTree
79 {
80 return $this["tree"];
81 }
82
86 public function language(): \ilLanguage
87 {
88 return $this["lng"];
89 }
90
94 public function logger(): \ILIAS\DI\LoggingServices
95 {
96 return new LoggingServices($this);
97 }
98
102 public function toolbar(): \ilToolbarGUI
103 {
104 return $this["ilToolbar"];
105 }
106
110 public function tabs(): \ilTabsGUI
111 {
112 return $this["ilTabs"];
113 }
114
118 public function ui(): \ILIAS\DI\UIServices
119 {
120 return new UIServices($this);
121 }
122
126 public function settings(): \ilSetting
127 {
128 return $this["ilSetting"];
129 }
130
131
136 {
137 return $this['filesystem'];
138 }
139
140
144 public function upload(): \ILIAS\FileUpload\FileUpload
145 {
146 return $this['upload'];
147 }
148
150 {
151 return new BackgroundTaskServices($this);
152 }
153
154
155 public function globalScreen(): \ILIAS\GlobalScreen\Services
156 {
157 return $this['global_screen'];
158 }
159
160
164 public function http(): \ILIAS\HTTP\Services
165 {
166 return $this['http'];
167 }
168
169 public function event(): \ilAppEventHandler
170 {
171 return $this['ilAppEventHandler'];
172 }
173
174 public function iliasIni(): \ilIniFile
175 {
176 return $this['ilIliasIniFile'];
177 }
178
179 public function clientIni(): \ilIniFile
180 {
181 return $this['ilClientIniFile'];
182 }
183
184 public function systemStyle(): \ilStyleDefinition
185 {
186 return $this['styleDefinition'];
187 }
188
189 public function help(): \ilHelpGUI
190 {
191 return $this['ilHelp'];
192 }
193
194 public function question(): \ilAsqFactory
195 {
196 return new \ilAsqFactory();
197 }
198
202 public function conditions(): \ilConditionService
203 {
204 return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
205 }
206
208 {
209 return new \ilLearningHistoryService(
210 $this->user(),
211 $this->language(),
212 $this->ui(),
213 $this->access(),
214 $this->repositoryTree()
215 );
216 }
217
218 public function news(): \ilNewsService
219 {
220 return new \ilNewsService($this->language(), $this->settings(), $this->user());
221 }
222
223 public function object(): \ilObjectService
224 {
225 return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
226 }
227
228 public function exercise(): \ILIAS\Exercise\Service
229 {
230 return new \ILIAS\Exercise\Service();
231 }
232
233 public function task(): \ilTaskService
234 {
235 return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
236 }
237
238
239 public function refinery(): \ILIAS\Refinery\Factory
240 {
241 return $this['refinery'];
242 }
243
244
245 public function uiService(): \ilUIService
246 {
247 return new \ilUIService($this->http()->request(), $this->ui());
248 }
249
250
251 public function bookingManager(): \ILIAS\BookingManager\Service
252 {
253 return new \ILIAS\BookingManager\Service($this);
254 }
255
256 public function skills(): \ILIAS\Skill\Service\SkillService
257 {
258 return new SkillService();
259 }
260
261 public function resourceStorage(): \ILIAS\ResourceStorage\Services
262 {
263 return $this['resource_storage'];
264 }
265
266 public function repository(): Repository\Service
267 {
268 return new Repository\Service($this);
269 }
270
271 public function container(): \ILIAS\Container\Service
272 {
273 return new \ILIAS\Container\Service($this);
274 }
275
276 public function containerReference(): \ILIAS\ContainerReference\Service
277 {
278 return new \ILIAS\ContainerReference\Service($this);
279 }
280
281 public function category(): \ILIAS\Category\Service
282 {
283 return new \ILIAS\Category\Service($this);
284 }
285
286 public function folder(): \ILIAS\Folder\Service
287 {
288 return new \ILIAS\Folder\Service($this);
289 }
290
291 public function rootFolder(): \ILIAS\RootFolder\Service
292 {
293 return new \ILIAS\RootFolder\Service($this);
294 }
295
296 public function copage(): \ILIAS\COPage\Service
297 {
298 return new \ILIAS\COPage\Service($this);
299 }
300
301 public function learningModule(): \ILIAS\LearningModule\Service
302 {
303 return new \ILIAS\LearningModule\Service($this);
304 }
305
306 public function wiki(): \ILIAS\Wiki\Service
307 {
308 return new \ILIAS\Wiki\Service($this);
309 }
310
311 public function mediaObjects(): \ILIAS\MediaObjects\Service
312 {
313 return new \ILIAS\MediaObjects\Service($this);
314 }
315
316 public function survey(): \ILIAS\Survey\Service
317 {
318 return new \ILIAS\Survey\Service();
319 }
320
321 public function surveyQuestionPool(): \ILIAS\SurveyQuestionPool\Service
322 {
323 return new \ILIAS\SurveyQuestionPool\Service($this);
324 }
325
326 public function test(): \ILIAS\Test\Service
327 {
328 return new \ILIAS\Test\Service($this);
329 }
330
331 public function testQuestionPool(): \ILIAS\TestQuestionPool\Service
332 {
333 return new \ILIAS\TestQuestionPool\Service($this);
334 }
335
336 public function workflowEngine(): \ILIAS\WorkflowEngine\Service
337 {
338 return new \ILIAS\WorkflowEngine\Service($this);
339 }
340
341 public function mediaPool(): \ILIAS\MediaPool\Service
342 {
343 return new \ILIAS\MediaPool\Service($this);
344 }
345
346 public function notes(): \ILIAS\Notes\Service
347 {
348 return new \ILIAS\Notes\Service($this);
349 }
350
351 public function glossary(): \ILIAS\Glossary\Service
352 {
353 return new \ILIAS\Glossary\Service($this);
354 }
355
356 public function portfolio(): \ILIAS\Portfolio\Service
357 {
358 return new \ILIAS\Portfolio\Service($this);
359 }
360
361 public function blog(): \ILIAS\Blog\Service
362 {
363 return new \ILIAS\Blog\Service($this);
364 }
365
366 public function mediaCast(): \ILIAS\MediaCast\Service
367 {
368 return new \ILIAS\MediaCast\Service($this);
369 }
370
371 public function itemGroup(): \ILIAS\ItemGroup\Service
372 {
373 return new \ILIAS\ItemGroup\Service($this);
374 }
375
376 public function htmlLearningModule(): \ILIAS\HTMLLearningModule\Service
377 {
378 return new \ILIAS\HTMLLearningModule\Service($this);
379 }
380
381 public function awareness(): \ILIAS\Awareness\Service
382 {
383 return new \ILIAS\Awareness\Service($this);
384 }
385
387 {
388 if ($this->file_service_settings === null) {
389 $this->file_service_settings = new \ilFileServicesSettings(
390 $this->settings(),
391 $this->clientIni(),
392 $this->database()
393 );
394 }
396 }
397
398 public function contentStyle(): \ILIAS\Style\Content\Service
399 {
400 return new \ILIAS\Style\Content\Service($this);
401 }
402
403 public function notifications(): \ILIAS\Notifications\Service
404 {
405 return new \ILIAS\Notifications\Service($this);
406 }
407
408 public function cron(): \ilCronServices
409 {
410 return new \ilCronServicesImpl($this);
411 }
412
430 public function isDependencyAvailable(string $name): bool
431 {
432 try {
433 $this->$name();
434 } catch (\InvalidArgumentException $e) {
435 return false;
436 } catch (\TypeError $e) {
437 return false;
438 }
439
440 return true;
441 }
442}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
isDependencyAvailable(string $name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:430
access()
Get interface for access checks.
Definition: Container.php:70
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:94
database()
Get interface to the Database.
Definition: Container.php:38
filesystem()
Get the Filesystem service interface.
Definition: Container.php:135
user()
Get the current user.
Definition: Container.php:62
language()
Get interface to the i18n service.
Definition: Container.php:86
conditions()
Get conditions service.
Definition: Container.php:202
ilFileServicesSettings $file_service_settings
Definition: Container.php:33
ui()
Get the interface to get services from UI framework.
Definition: Container.php:118
settings()
Get the interface to the settings.
Definition: Container.php:126
ctrl()
Get the interface to the control structure.
Definition: Container.php:54
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:78
toolbar()
Get interface to the toolbar.
Definition: Container.php:102
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:46
tabs()
Get interface to the tabs.
Definition: Container.php:110
upload()
Gets the file upload interface.
Definition: Container.php:144
Provides fluid interface to LoggingServices.
Provides fluid interface to RBAC services.
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
Builds data types.
Definition: Factory.php:21
Global event handler.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Help GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilStyleDefinition acts as a wrapper of style related actions.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Filter service.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
if($format !==null) $name
Definition: metadata.php:247
Class HTTPServicesTest.
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Container.php:19
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.