ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
BaseDependencyMap.php
Go to the documentation of this file.
1 <?php
2 
20 
25 
32 {
33  protected array $map = [];
34 
35  public function __construct()
36  {
37  $this->maps = [function (\ILIAS\DI\Container $DIC, $fullyQualifiedDomainName, $for) {
38  return $this->resolveBaseDependencies($DIC, $fullyQualifiedDomainName, $for);
39  }];
40  }
41 
42  protected function resolveBaseDependencies(Container $DIC, $fullyQualifiedDomainName, $for)
43  {
44  // wow, why a switch statement and not an array?
45  // because we don't really want type unsafe array access on $DIC.
46  switch ($fullyQualifiedDomainName) {
47  case \ilDBInterface::class:
48  return $DIC->database();
49  case \ilRbacAdmin::class:
50  return $DIC->rbac()->admin();
51  case \ilRbacReview::class:
52  return $DIC->rbac()->review();
53  case \ilRbacSystem::class:
54  return $DIC->rbac()->system();
55  case \ilAccessHandler::class:
56  return $DIC->access();
57  case \ilCtrl::class:
58  return $DIC->ctrl();
59  case \ilObjUser::class:
60  return $DIC->user();
61  case \ilTree::class:
62  return $DIC->repositoryTree();
63  case \ilLanguage::class:
64  return $DIC->language();
65  case \ilLoggerFactory::class:
66  return $DIC["ilLoggerFactory"];
67  case \ilLogger::class:
68  return $DIC->logger()->root();
69  case \ilToolbarGUI::class:
70  return $DIC->toolbar();
71  case \ilTabsGUI::class:
72  return $DIC->tabs();
73  case Injector::class:
74  return $DIC->backgroundTasks()->injector();
75  case \ilSetting::class:
76  return $DIC->settings();
77  case \ILIAS\UI\Factory::class:
78  return $DIC->ui()->factory();
79  case \ILIAS\UI\Renderer::class:
80  return $DIC->ui()->renderer();
81  case \ilTemplate::class:
82  return $DIC->ui()->mainTemplate();
83  case Persistence::class:
84  return $DIC->backgroundTasks()->persistence();
85  case TaskFactory::class:
86  return $DIC->backgroundTasks()->taskFactory();
87  }
88  return null;
89  }
90 }
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:94
user()
Get the current user.
Definition: Container.php:62
database()
Get interface to the Database.
Definition: Container.php:38
tabs()
Get interface to the tabs.
Definition: Container.php:110
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:78
resolveBaseDependencies(Container $DIC, $fullyQualifiedDomainName, $for)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
toolbar()
Get interface to the toolbar.
Definition: Container.php:102
language()
Get interface to the i18n service.
Definition: Container.php:86
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:46
access()
Get interface for access checks.
Definition: Container.php:70
ctrl()
Get the interface to the control structure.
Definition: Container.php:54
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