ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Container.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\DI;
20
28
35class Container extends \Pimple\Container
36{
38
42 public function database(): \ilDBInterface
43 {
44 return $this["ilDB"];
45 }
46
47 public function globalCache(): Services
48 {
49 return $this["global_cache"] ?? new Services(null);
50 }
51
55 public function rbac(): \ILIAS\DI\RBACServices
56 {
57 return new RBACServices($this);
58 }
59
63 public function ctrl(): \ilCtrlInterface
64 {
65 return $this["ilCtrl"];
66 }
67
71 public function user(): \ilObjUser
72 {
73 return $this["ilUser"];
74 }
75
79 public function access(): \ilAccessHandler
80 {
81 return $this["ilAccess"];
82 }
83
87 public function repositoryTree(): \ilTree
88 {
89 return $this["tree"];
90 }
91
95 public function language(): \ilLanguage
96 {
97 return $this["lng"];
98 }
99
103 public function logger(): \ILIAS\DI\LoggingServices
104 {
105 return new LoggingServices($this);
106 }
107
111 public function toolbar(): \ilToolbarGUI
112 {
113 return $this["ilToolbar"];
114 }
115
119 public function tabs(): \ilTabsGUI
120 {
121 return $this["ilTabs"];
122 }
123
127 public function ui(): \ILIAS\DI\UIServices
128 {
129 return new UIServices($this);
130 }
131
135 public function settings(): \ilSetting
136 {
137 return $this["ilSetting"];
138 }
139
140
145 {
146 return $this['filesystem'];
147 }
148
149
153 public function upload(): \ILIAS\FileUpload\FileUpload
154 {
155 return $this['upload'];
156 }
157
159 {
160 return new BackgroundTaskServices($this);
161 }
162
163
165 {
166 return $this['global_screen'];
167 }
168
169
173 public function http(): \ILIAS\HTTP\Services
174 {
175 return $this['http'];
176 }
177
178 public function event(): \ilAppEventHandler
179 {
180 return $this['ilAppEventHandler'];
181 }
182
183 public function iliasIni(): \ilIniFile
184 {
185 return $this['ilIliasIniFile'];
186 }
187
188 public function clientIni(): \ilIniFile
189 {
190 return $this['ilClientIniFile'];
191 }
192
193 public function systemStyle(): \ilStyleDefinition
194 {
195 return $this['styleDefinition'];
196 }
197
198 public function help(): \ilHelpGUI
199 {
200 return $this['ilHelp'];
201 }
202
206 public function conditions(): \ilConditionService
207 {
208 return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
209 }
210
212 {
213 return new \ilLearningHistoryService(
214 $this->user(),
215 $this->language(),
216 $this->ui(),
217 $this->access(),
218 $this->repositoryTree()
219 );
220 }
221
222 public function news(): \ILIAS\News\Service
223 {
224 return new \ILIAS\News\Service($this);
225 }
226
227 public function object(): \ilObjectService
228 {
229 return new \ilObjectService();
230 }
231
232 public function exercise(): \ILIAS\Exercise\Service
233 {
234 return new \ILIAS\Exercise\Service();
235 }
236
237 public function task(): \ilTaskService
238 {
239 return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
240 }
241
242
243 public function refinery(): \ILIAS\Refinery\Factory
244 {
245 return $this['refinery'];
246 }
247
248
249 public function uiService(): \ilUIService
250 {
251 return new \ilUIService($this->http()->request(), $this->ui());
252 }
253
254
256 {
257 return new \ILIAS\BookingManager\Service($this);
258 }
259
261 {
262 return new SkillService();
263 }
264
266 {
267 return $this['resource_storage'];
268 }
269
270 public function repository(): Repository\Service
271 {
272 return new Repository\Service($this);
273 }
274
275 public function container(): \ILIAS\Container\Service
276 {
277 return new \ILIAS\Container\Service($this);
278 }
279
281 {
282 return new \ILIAS\ContainerReference\Service($this);
283 }
284
285 public function category(): \ILIAS\Category\Service
286 {
287 return new \ILIAS\Category\Service($this);
288 }
289
290 public function folder(): \ILIAS\Folder\Service
291 {
292 return new \ILIAS\Folder\Service($this);
293 }
294
295 public function rootFolder(): \ILIAS\RootFolder\Service
296 {
297 return new \ILIAS\RootFolder\Service($this);
298 }
299
300 public function copage(): \ILIAS\COPage\Service
301 {
302 return new \ILIAS\COPage\Service($this);
303 }
304
306 {
307 return new \ILIAS\LearningModule\Service($this);
308 }
309
310 public function wiki(): \ILIAS\Wiki\Service
311 {
312 return new \ILIAS\Wiki\Service($this);
313 }
314
316 {
317 return new \ILIAS\MediaObjects\Service($this);
318 }
319
320 public function survey(): \ILIAS\Survey\Service
321 {
322 return new \ILIAS\Survey\Service();
323 }
324
326 {
327 return new \ILIAS\SurveyQuestionPool\Service($this);
328 }
329
330 public function testQuestion(): \ILIAS\TestQuestionPool\Questions\PublicInterface
331 {
332 return new \ILIAS\TestQuestionPool\Questions\PublicInterface($this);
333 }
334
335 public function workflowEngine(): \ILIAS\WorkflowEngine\Service
336 {
337 return new \ILIAS\WorkflowEngine\Service($this);
338 }
339
340 public function mediaPool(): \ILIAS\MediaPool\Service
341 {
342 return new \ILIAS\MediaPool\Service($this);
343 }
344
345 public function notes(): \ILIAS\Notes\Service
346 {
347 return new \ILIAS\Notes\Service($this);
348 }
349
350 public function glossary(): \ILIAS\Glossary\Service
351 {
352 return new \ILIAS\Glossary\Service($this);
353 }
354
355 public function portfolio(): \ILIAS\Portfolio\Service
356 {
357 return new \ILIAS\Portfolio\Service($this);
358 }
359
360 public function blog(): \ILIAS\Blog\Service
361 {
362 return new \ILIAS\Blog\Service($this);
363 }
364
365 public function mediaCast(): \ILIAS\MediaCast\Service
366 {
367 return new \ILIAS\MediaCast\Service($this);
368 }
369
370 public function itemGroup(): \ILIAS\ItemGroup\Service
371 {
372 return new \ILIAS\ItemGroup\Service($this);
373 }
374
376 {
377 return new \ILIAS\HTMLLearningModule\Service($this);
378 }
379
380 public function awareness(): \ILIAS\Awareness\Service
381 {
382 return new \ILIAS\Awareness\Service($this);
383 }
384
385 public function export(): \ILIAS\Export\Service
386 {
387 return new \ILIAS\Export\Service();
388 }
389
391 {
392 return new \ILIAS\PersonalWorkspace\Service();
393 }
394
395 public function taxonomy(): \ILIAS\Taxonomy\Service
396 {
397 return new \ILIAS\Taxonomy\Service($this);
398 }
399
400 public function infoScreen(): \ILIAS\InfoScreen\Service
401 {
402 return new \ILIAS\InfoScreen\Service($this);
403 }
404
406 {
407 if ($this->file_service_settings === null) {
408 $this->file_service_settings = new \ilFileServicesSettings(
409 $this->settings(),
410 $this->clientIni(),
411 $this->database()
412 );
413 }
415 }
416
417
418 public function archives(): Archives
419 {
420 return new Archives();
421 }
422
427 {
428 return new LegacyArchives();
429 }
430
431 public function fileConverters(): Converters
432 {
433 return new Converters();
434 }
435
437 {
438 return new \ILIAS\Style\Content\Service($this);
439 }
440
442 {
443 return new \ILIAS\Notifications\Service($this);
444 }
445
446 public function cron(): \ILIAS\Cron\CronServices
447 {
448 return new \ILIAS\Cron\Services\ServicesImpl($this);
449 }
450
451 public function mail(): \ILIAS\Mail\Service\MailService
452 {
453 return new \ILIAS\Mail\Service\MailService($this);
454 }
455
456 public function certificate(): \ILIAS\Certificate\Service\CertificateService
457 {
458 return new \ILIAS\Certificate\Service\CertificateService($this);
459 }
460
462 {
463 return $this['file_delivery'];
464 }
465
466 public function learningObjectMetadata(): \ILIAS\MetaData\Services\ServicesInterface
467 {
468 return $this['learning_object_metadata'] ?? new \ILIAS\MetaData\Services\Services($this);
469 }
470
471 public function like(): \ILIAS\Like\Service
472 {
473 return new \ILIAS\Like\Service($this);
474 }
475
476
494 public function isDependencyAvailable(string $name): bool
495 {
496 try {
497 $this->$name();
498 } catch (\InvalidArgumentException $e) {
499 return false;
500 } catch (\TypeError $e) {
501 return false;
502 }
503
504 return true;
505 }
506}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
isDependencyAvailable(string $name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:494
access()
Get interface for access checks.
Definition: Container.php:79
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:103
database()
Get interface to the Database.
Definition: Container.php:42
filesystem()
Get the Filesystem service interface.
Definition: Container.php:144
user()
Get the current user.
Definition: Container.php:71
language()
Get interface to the i18n service.
Definition: Container.php:95
conditions()
Get conditions service.
Definition: Container.php:206
ilFileServicesSettings $file_service_settings
Definition: Container.php:37
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
settings()
Get the interface to the settings.
Definition: Container.php:135
ctrl()
Get the interface to the control structure.
Definition: Container.php:63
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:87
toolbar()
Get interface to the toolbar.
Definition: Container.php:111
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:55
tabs()
Get interface to the tabs.
Definition: Container.php:119
upload()
Gets the file upload interface.
Definition: Container.php:153
Provides fluid interface to LoggingServices.
Provides fluid interface to RBAC services.
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
Builds data types.
Definition: Factory.php:36
Global event handler.
Help GUI class.
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
ILIAS Setting Class.
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...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Filter service.
The Filesystems interface defines the access methods which can be used to fetch the different filesys...
Definition: Filesystems.php:30
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
Class HTTPServicesTest.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Container.php:19
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
RFC 822 Email address list validation Utility.