ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Container.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\DI;
5
9
17{
23 public function database()
24 {
25 return $this["ilDB"];
26 }
27
33 public function rbac()
34 {
35 return new RBACServices($this);
36 }
37
43 public function ctrl()
44 {
45 return $this["ilCtrl"];
46 }
47
53 public function user()
54 {
55 return $this["ilUser"];
56 }
57
63 public function access()
64 {
65 return $this["ilAccess"];
66 }
67
73 public function repositoryTree()
74 {
75 return $this["tree"];
76 }
77
83 public function language()
84 {
85 return $this["lng"];
86 }
87
93 public function logger()
94 {
95 return new LoggingServices($this);
96 }
97
103 public function toolbar()
104 {
105 return $this["ilToolbar"];
106 }
107
113 public function tabs()
114 {
115 return $this["ilTabs"];
116 }
117
123 public function ui()
124 {
125 return new UIServices($this);
126 }
127
133 public function settings()
134 {
135 return $this["ilSetting"];
136 }
137
138
144 public function filesystem()
145 {
146 return $this['filesystem'];
147 }
148
149
155 public function upload()
156 {
157 return $this['upload'];
158 }
159
160
164 public function backgroundTasks()
165 {
166 return new BackgroundTaskServices($this);
167 }
168
169
173 public function globalScreen()
174 {
175 return $this['global_screen'];
176 }
177
178
182 public function http()
183 {
184 return $this['http'];
185 }
186
190 public function event()
191 {
192 return $this['ilAppEventHandler'];
193 }
194
198 public function iliasIni()
199 {
200 return $this['ilIliasIniFile'];
201 }
202
206 public function clientIni()
207 {
208 return $this['ilClientIniFile'];
209 }
210
214 public function systemStyle()
215 {
216 return $this['styleDefinition'];
217 }
218
222 public function help()
223 {
224 return $this['ilHelp'];
225 }
226
232 public function conditions()
233 {
234 return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
235 }
236
240 public function learningHistory()
241 {
242 return new \ilLearningHistoryService(
243 $this->user(),
244 $this->language(),
245 $this->ui(),
246 $this->access(),
247 $this->repositoryTree()
248 );
249 }
250
254 public function news()
255 {
256 return new \ilNewsService($this->language(), $this->settings(), $this->user());
257 }
258
262 public function object()
263 {
264 return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
265 }
266
267
289 {
290 try {
291 $this->$name();
292 } catch (\InvalidArgumentException $e) {
293 return false;
294 }
295 return true;
296 }
297}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:17
access()
Get interface for access checks.
Definition: Container.php:63
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:93
database()
Get interface to the Database.
Definition: Container.php:23
filesystem()
Get the Filesystem service interface.
Definition: Container.php:144
user()
Get the current user.
Definition: Container.php:53
language()
Get interface to the i18n service.
Definition: Container.php:83
conditions()
Get conditions service.
Definition: Container.php:232
ui()
Get the interface to get services from UI framework.
Definition: Container.php:123
settings()
Get the interface to the settings.
Definition: Container.php:133
ctrl()
Get the interface to the control structure.
Definition: Container.php:43
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:73
toolbar()
Get interface to the toolbar.
Definition: Container.php:103
isDependencyAvailable($name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:288
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:33
tabs()
Get interface to the tabs.
Definition: Container.php:113
upload()
Gets the file upload interface.
Definition: Container.php:155
Provides fluid interface to RBAC services.
Provides fluid interface to RBAC services.
Provides fluid interface to RBAC services.
Definition: UIServices.php:10
Container main class.
Definition: Container.php:35
Class HTTPServicesTest.