ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Container.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\DI;
20 
28 
35 class 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 
203  public function question(): \ilAsqFactory
204  {
205  return new \ilAsqFactory();
206  }
207 
211  public function conditions(): \ilConditionService
212  {
213  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
214  }
215 
217  {
218  return new \ilLearningHistoryService(
219  $this->user(),
220  $this->language(),
221  $this->ui(),
222  $this->access(),
223  $this->repositoryTree()
224  );
225  }
226 
227  public function news(): \ILIAS\News\Service
228  {
229  return new \ILIAS\News\Service($this);
230  }
231 
232  public function object(): \ilObjectService
233  {
234  return new \ilObjectService();
235  }
236 
237  public function exercise(): \ILIAS\Exercise\Service
238  {
239  return new \ILIAS\Exercise\Service();
240  }
241 
242  public function task(): \ilTaskService
243  {
244  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
245  }
246 
247 
248  public function refinery(): \ILIAS\Refinery\Factory
249  {
250  return $this['refinery'];
251  }
252 
253 
254  public function uiService(): \ilUIService
255  {
256  return new \ilUIService($this->http()->request(), $this->ui());
257  }
258 
259 
260  public function bookingManager(): \ILIAS\BookingManager\Service
261  {
262  return new \ILIAS\BookingManager\Service($this);
263  }
264 
265  public function skills(): \ILIAS\Skill\Service\SkillService
266  {
267  return new SkillService();
268  }
269 
271  {
272  return $this['resource_storage'];
273  }
274 
275  public function repository(): Repository\Service
276  {
277  return new Repository\Service($this);
278  }
279 
280  public function container(): \ILIAS\Container\Service
281  {
282  return new \ILIAS\Container\Service($this);
283  }
284 
285  public function containerReference(): \ILIAS\ContainerReference\Service
286  {
287  return new \ILIAS\ContainerReference\Service($this);
288  }
289 
290  public function category(): \ILIAS\Category\Service
291  {
292  return new \ILIAS\Category\Service($this);
293  }
294 
295  public function folder(): \ILIAS\Folder\Service
296  {
297  return new \ILIAS\Folder\Service($this);
298  }
299 
300  public function rootFolder(): \ILIAS\RootFolder\Service
301  {
302  return new \ILIAS\RootFolder\Service($this);
303  }
304 
305  public function copage(): \ILIAS\COPage\Service
306  {
307  return new \ILIAS\COPage\Service($this);
308  }
309 
310  public function learningModule(): \ILIAS\LearningModule\Service
311  {
312  return new \ILIAS\LearningModule\Service($this);
313  }
314 
315  public function wiki(): \ILIAS\Wiki\Service
316  {
317  return new \ILIAS\Wiki\Service($this);
318  }
319 
320  public function mediaObjects(): \ILIAS\MediaObjects\Service
321  {
322  return new \ILIAS\MediaObjects\Service($this);
323  }
324 
325  public function survey(): \ILIAS\Survey\Service
326  {
327  return new \ILIAS\Survey\Service();
328  }
329 
330  public function surveyQuestionPool(): \ILIAS\SurveyQuestionPool\Service
331  {
332  return new \ILIAS\SurveyQuestionPool\Service($this);
333  }
334 
335  public function test(): \ILIAS\Test\Service
336  {
337  return new \ILIAS\Test\Service($this);
338  }
339 
340  public function testQuestionPool(): \ILIAS\TestQuestionPool\Service
341  {
342  return new \ILIAS\TestQuestionPool\Service($this);
343  }
344 
345  public function workflowEngine(): \ILIAS\WorkflowEngine\Service
346  {
347  return new \ILIAS\WorkflowEngine\Service($this);
348  }
349 
350  public function mediaPool(): \ILIAS\MediaPool\Service
351  {
352  return new \ILIAS\MediaPool\Service($this);
353  }
354 
355  public function notes(): \ILIAS\Notes\Service
356  {
357  return new \ILIAS\Notes\Service($this);
358  }
359 
360  public function glossary(): \ILIAS\Glossary\Service
361  {
362  return new \ILIAS\Glossary\Service($this);
363  }
364 
365  public function portfolio(): \ILIAS\Portfolio\Service
366  {
367  return new \ILIAS\Portfolio\Service($this);
368  }
369 
370  public function blog(): \ILIAS\Blog\Service
371  {
372  return new \ILIAS\Blog\Service($this);
373  }
374 
375  public function mediaCast(): \ILIAS\MediaCast\Service
376  {
377  return new \ILIAS\MediaCast\Service($this);
378  }
379 
380  public function itemGroup(): \ILIAS\ItemGroup\Service
381  {
382  return new \ILIAS\ItemGroup\Service($this);
383  }
384 
385  public function htmlLearningModule(): \ILIAS\HTMLLearningModule\Service
386  {
387  return new \ILIAS\HTMLLearningModule\Service($this);
388  }
389 
390  public function awareness(): \ILIAS\Awareness\Service
391  {
392  return new \ILIAS\Awareness\Service($this);
393  }
394 
395  public function export(): \ILIAS\Export\Service
396  {
397  return new \ILIAS\Export\Service();
398  }
399 
400  public function personalWorkspace(): \ILIAS\PersonalWorkspace\Service
401  {
402  return new \ILIAS\PersonalWorkspace\Service();
403  }
404 
405  public function taxonomy(): \ILIAS\Taxonomy\Service
406  {
407  return new \ILIAS\Taxonomy\Service($this);
408  }
409 
410  public function infoScreen(): \ILIAS\InfoScreen\Service
411  {
412  return new \ILIAS\InfoScreen\Service($this);
413  }
414 
416  {
417  if ($this->file_service_settings === null) {
418  $this->file_service_settings = new \ilFileServicesSettings(
419  $this->settings(),
420  $this->clientIni(),
421  $this->database()
422  );
423  }
425  }
426 
427 
428  public function archives(): Archives
429  {
430  return new Archives();
431  }
432 
436  public function legacyArchives(): LegacyArchives
437  {
438  return new LegacyArchives();
439  }
440 
441  public function fileConverters(): Converters
442  {
443  return new Converters();
444  }
445 
446  public function contentStyle(): \ILIAS\Style\Content\Service
447  {
448  return new \ILIAS\Style\Content\Service($this);
449  }
450 
451  public function notifications(): \ILIAS\Notifications\Service
452  {
453  return new \ILIAS\Notifications\Service($this);
454  }
455 
456  public function cron(): \ilCronServices
457  {
458  return new \ilCronServicesImpl($this);
459  }
460 
461  public function mail(): \ILIAS\Mail\Service\MailService
462  {
463  return new \ILIAS\Mail\Service\MailService($this);
464  }
465 
466  public function certificate(): \ILIAS\Certificate\Service\CertificateService
467  {
468  return new \ILIAS\Certificate\Service\CertificateService($this);
469  }
470 
471  public function fileDelivery(): \ILIAS\FileDelivery\Services
472  {
473  return $this['file_delivery'];
474  }
475 
476  public function learningObjectMetadata(): \ILIAS\MetaData\Services\ServicesInterface
477  {
478  return new \ILIAS\MetaData\Services\Services($this);
479  }
480 
498  public function isDependencyAvailable(string $name): bool
499  {
500  try {
501  $this->$name();
502  } catch (\InvalidArgumentException $e) {
503  return false;
504  } catch (\TypeError $e) {
505  return false;
506  }
507 
508  return true;
509  }
510 }
Global event handler.
Wraps ilObject dependencies.
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:103
user()
Get the current user.
Definition: Container.php:71
isDependencyAvailable(string $name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:498
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
database()
Get interface to the Database.
Definition: Container.php:42
Provides fluid interface to LoggingServices.
Class ChatMainBarProvider .
Help GUI class.
tabs()
Get interface to the tabs.
Definition: Container.php:119
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...
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:87
Filter service.
conditions()
Get conditions service.
Definition: Container.php:211
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Container.php:19
toolbar()
Get interface to the toolbar.
Definition: Container.php:111
ilFileServicesSettings $file_service_settings
Definition: Container.php:37
Provides fluid interface to RBAC services.
Definition: UIServices.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class HTTPServicesTest.
RFC 822 Email address list validation Utility.
language()
Get interface to the i18n service.
Definition: Container.php:95
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:55
Provides fluid interface to RBAC services.
upload()
Gets the file upload interface.
Definition: Container.php:153
filesystem()
Get the Filesystem service interface.
Definition: Container.php:144
Class FileUpload.
Definition: FileUpload.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
access()
Get interface for access checks.
Definition: Container.php:79
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.
Task service.
ctrl()
Get the interface to the control structure.
Definition: Container.php:63
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
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...
The Filesystems interface defines the access methods which can be used to fetch the different filesys...
Definition: Filesystems.php:29
settings()
Get the interface to the settings.
Definition: Container.php:135