ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
4 namespace ILIAS\DI;
5 
11 
18 class Container extends \Pimple\Container
19 {
25  public function database()
26  {
27  return $this["ilDB"];
28  }
29 
35  public function rbac()
36  {
37  return new RBACServices($this);
38  }
39 
45  public function ctrl()
46  {
47  return $this["ilCtrl"];
48  }
49 
55  public function user()
56  {
57  return $this["ilUser"];
58  }
59 
65  public function access()
66  {
67  return $this["ilAccess"];
68  }
69 
75  public function repositoryTree()
76  {
77  return $this["tree"];
78  }
79 
85  public function language()
86  {
87  return $this["lng"];
88  }
89 
95  public function logger()
96  {
97  return new LoggingServices($this);
98  }
99 
105  public function toolbar()
106  {
107  return $this["ilToolbar"];
108  }
109 
115  public function tabs()
116  {
117  return $this["ilTabs"];
118  }
119 
125  public function ui()
126  {
127  return new UIServices($this);
128  }
129 
135  public function settings()
136  {
137  return $this["ilSetting"];
138  }
139 
140 
146  public function filesystem()
147  {
148  return $this['filesystem'];
149  }
150 
151 
157  public function upload()
158  {
159  return $this['upload'];
160  }
161 
162 
166  public function backgroundTasks()
167  {
168  return new BackgroundTaskServices($this);
169  }
170 
171 
175  public function globalScreen()
176  {
177  return $this['global_screen'];
178  }
179 
180 
184  public function http()
185  {
186  return $this['http'];
187  }
188 
192  public function event()
193  {
194  return $this['ilAppEventHandler'];
195  }
196 
200  public function iliasIni()
201  {
202  return $this['ilIliasIniFile'];
203  }
204 
208  public function clientIni()
209  {
210  return $this['ilClientIniFile'];
211  }
212 
216  public function systemStyle()
217  {
218  return $this['styleDefinition'];
219  }
220 
224  public function help()
225  {
226  return $this['ilHelp'];
227  }
228 
232  public function question()
233  {
234  return new \ilAsqFactory();
235  }
236 
242  public function conditions()
243  {
244  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
245  }
246 
250  public function learningHistory()
251  {
252  return new \ilLearningHistoryService(
253  $this->user(),
254  $this->language(),
255  $this->ui(),
256  $this->access(),
257  $this->repositoryTree()
258  );
259  }
260 
264  public function news()
265  {
266  return new \ilNewsService($this->language(), $this->settings(), $this->user());
267  }
268 
272  public function object()
273  {
274  return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
275  }
276 
280  public function exercise()
281  {
282  return new \ilExerciseFactory();
283  }
284 
288  public function task()
289  {
290  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
291  }
292 
293 
297  public function refinery()
298  {
299  return $this['refinery'];
300  }
301 
302 
306  public function uiService()
307  {
308  return new \ilUIService($this->http()->request(), $this->ui());
309  }
310 
311 
315  public function bookingManager()
316  {
317  return new \ilBookingManagerService();
318  }
319 
320 
324  public function skills()
325  {
326  return new SkillService();
327  }
328 
329  public function resourceStorage() : \ILIAS\ResourceStorage\Services
330  {
331  return $this['resource_storage'];
332  }
333 
334 
355  public function isDependencyAvailable($name)
356  {
357  try {
358  $this->$name();
359  } catch (\InvalidArgumentException $e) {
360  return false;
361  }
362  return true;
363  }
364 }
Wraps ilObject dependencies.
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:95
user()
Get the current user.
Definition: Container.php:55
database()
Get interface to the Database.
Definition: Container.php:25
Provides fluid interface to RBAC services.
Class ChatMainBarProvider .
tabs()
Get interface to the tabs.
Definition: Container.php:115
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:75
conditions()
Get conditions service.
Definition: Container.php:242
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isDependencyAvailable($name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:355
toolbar()
Get interface to the toolbar.
Definition: Container.php:105
if($format !==null) $name
Definition: metadata.php:230
Provides fluid interface to RBAC services.
Definition: UIServices.php:9
language()
Get interface to the i18n service.
Definition: Container.php:85
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:35
Provides fluid interface to RBAC services.
Definition: RBACServices.php:9
upload()
Gets the file upload interface.
Definition: Container.php:157
filesystem()
Get the Filesystem service interface.
Definition: Container.php:146
access()
Get interface for access checks.
Definition: Container.php:65
ctrl()
Get the interface to the control structure.
Definition: Container.php:45
ui()
Get the interface to get services from UI framework.
Definition: Container.php:125
Class ilAsqQuestionAuthoringFactory.
settings()
Get the interface to the settings.
Definition: Container.php:135