ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 
10 
17 class Container extends \Pimple\Container
18 {
24  public function database()
25  {
26  return $this["ilDB"];
27  }
28 
34  public function rbac()
35  {
36  return new RBACServices($this);
37  }
38 
44  public function ctrl()
45  {
46  return $this["ilCtrl"];
47  }
48 
54  public function user()
55  {
56  return $this["ilUser"];
57  }
58 
64  public function access()
65  {
66  return $this["ilAccess"];
67  }
68 
74  public function repositoryTree()
75  {
76  return $this["tree"];
77  }
78 
84  public function language()
85  {
86  return $this["lng"];
87  }
88 
94  public function logger()
95  {
96  return new LoggingServices($this);
97  }
98 
104  public function toolbar()
105  {
106  return $this["ilToolbar"];
107  }
108 
114  public function tabs()
115  {
116  return $this["ilTabs"];
117  }
118 
124  public function ui()
125  {
126  return new UIServices($this);
127  }
128 
134  public function settings()
135  {
136  return $this["ilSetting"];
137  }
138 
139 
145  public function filesystem()
146  {
147  return $this['filesystem'];
148  }
149 
150 
156  public function upload()
157  {
158  return $this['upload'];
159  }
160 
161 
165  public function backgroundTasks()
166  {
167  return new BackgroundTaskServices($this);
168  }
169 
170 
174  public function globalScreen()
175  {
176  return $this['global_screen'];
177  }
178 
179 
183  public function http()
184  {
185  return $this['http'];
186  }
187 
191  public function event()
192  {
193  return $this['ilAppEventHandler'];
194  }
195 
199  public function iliasIni()
200  {
201  return $this['ilIliasIniFile'];
202  }
203 
207  public function clientIni()
208  {
209  return $this['ilClientIniFile'];
210  }
211 
215  public function systemStyle()
216  {
217  return $this['styleDefinition'];
218  }
219 
223  public function help()
224  {
225  return $this['ilHelp'];
226  }
227 
231  public function question()
232  {
233  return new \ilAsqFactory();
234  }
235 
241  public function conditions()
242  {
243  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
244  }
245 
249  public function learningHistory()
250  {
251  return new \ilLearningHistoryService(
252  $this->user(),
253  $this->language(),
254  $this->ui(),
255  $this->access(),
256  $this->repositoryTree()
257  );
258  }
259 
263  public function news()
264  {
265  return new \ilNewsService($this->language(), $this->settings(), $this->user());
266  }
267 
271  public function object()
272  {
273  return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
274  }
275 
279  public function exercise()
280  {
281  return new \ilExerciseFactory();
282  }
283 
287  public function task()
288  {
289  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
290  }
291 
292 
296  public function refinery()
297  {
298  return $this['refinery'];
299  }
300 
301 
305  public function uiService()
306  {
307  return new \ilUIService($this->http()->request(), $this->ui());
308  }
309 
310 
314  public function bookingManager()
315  {
316  return new \ilBookingManagerService();
317  }
318 
319 
340  public function isDependencyAvailable($name)
341  {
342  try {
343  $this->$name();
344  } catch (\InvalidArgumentException $e) {
345  return false;
346  }
347  return true;
348  }
349 }
Wraps ilObject dependencies.
logger()
Get interface to get interfaces to different loggers.
Definition: Container.php:94
user()
Get the current user.
Definition: Container.php:54
database()
Get interface to the Database.
Definition: Container.php:24
Provides fluid interface to RBAC services.
tabs()
Get interface to the tabs.
Definition: Container.php:114
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:74
conditions()
Get conditions service.
Definition: Container.php:241
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:17
Class HTTPServicesTest.
isDependencyAvailable($name)
Note: Only use isDependencyAvailable if strictly required.
Definition: Container.php:340
toolbar()
Get interface to the toolbar.
Definition: Container.php:104
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:84
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:34
Provides fluid interface to RBAC services.
Definition: RBACServices.php:9
upload()
Gets the file upload interface.
Definition: Container.php:156
filesystem()
Get the Filesystem service interface.
Definition: Container.php:145
access()
Get interface for access checks.
Definition: Container.php:64
ctrl()
Get the interface to the control structure.
Definition: Container.php:44
ui()
Get the interface to get services from UI framework.
Definition: Container.php:124
settings()
Get the interface to the settings.
Definition: Container.php:134