ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 
144  public function filesystem(): \ILIAS\Filesystem\Filesystems
145  {
146  return $this['filesystem'];
147  }
148 
149 
153  public function upload(): \ILIAS\FileUpload\FileUpload
154  {
155  return $this['upload'];
156  }
157 
158  public function backgroundTasks(): BackgroundTaskServices
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 
206  public function conditions(): \ilConditionService
207  {
208  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
209  }
210 
212  {
213  return new \ilLearningHistoryService(
214  $this->user(),
215  $this->language(),
216  $this->ui(),
217  $this->access(),
218  $this->repositoryTree()
219  );
220  }
221 
222  public function news(): \ILIAS\News\Service
223  {
224  return new \ILIAS\News\Service($this);
225  }
226 
227  public function object(): \ilObjectService
228  {
229  return new \ilObjectService();
230  }
231 
232  public function exercise(): \ILIAS\Exercise\Service
233  {
234  return new \ILIAS\Exercise\Service();
235  }
236 
237  public function task(): \ilTaskService
238  {
239  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
240  }
241 
242 
243  public function refinery(): \ILIAS\Refinery\Factory
244  {
245  return $this['refinery'];
246  }
247 
248 
249  public function uiService(): \ilUIService
250  {
251  return new \ilUIService($this->http()->request(), $this->ui());
252  }
253 
254 
255  public function bookingManager(): \ILIAS\BookingManager\Service
256  {
257  return new \ILIAS\BookingManager\Service($this);
258  }
259 
260  public function skills(): \ILIAS\Skill\Service\SkillService
261  {
262  return new SkillService();
263  }
264 
266  {
267  return $this['resource_storage'];
268  }
269 
270  public function repository(): Repository\Service
271  {
272  return new Repository\Service($this);
273  }
274 
275  public function container(): \ILIAS\Container\Service
276  {
277  return new \ILIAS\Container\Service($this);
278  }
279 
280  public function containerReference(): \ILIAS\ContainerReference\Service
281  {
282  return new \ILIAS\ContainerReference\Service($this);
283  }
284 
285  public function category(): \ILIAS\Category\Service
286  {
287  return new \ILIAS\Category\Service($this);
288  }
289 
290  public function folder(): \ILIAS\Folder\Service
291  {
292  return new \ILIAS\Folder\Service($this);
293  }
294 
295  public function rootFolder(): \ILIAS\RootFolder\Service
296  {
297  return new \ILIAS\RootFolder\Service($this);
298  }
299 
300  public function copage(): \ILIAS\COPage\Service
301  {
302  return new \ILIAS\COPage\Service($this);
303  }
304 
305  public function learningModule(): \ILIAS\LearningModule\Service
306  {
307  return new \ILIAS\LearningModule\Service($this);
308  }
309 
310  public function wiki(): \ILIAS\Wiki\Service
311  {
312  return new \ILIAS\Wiki\Service($this);
313  }
314 
315  public function mediaObjects(): \ILIAS\MediaObjects\Service
316  {
317  return new \ILIAS\MediaObjects\Service($this);
318  }
319 
320  public function survey(): \ILIAS\Survey\Service
321  {
322  return new \ILIAS\Survey\Service();
323  }
324 
325  public function surveyQuestionPool(): \ILIAS\SurveyQuestionPool\Service
326  {
327  return new \ILIAS\SurveyQuestionPool\Service($this);
328  }
329 
330  public function testQuestion(): \ILIAS\TestQuestionPool\Questions\PublicInterface
331  {
332  return new \ILIAS\TestQuestionPool\Questions\PublicInterface($this);
333  }
334 
335  public function workflowEngine(): \ILIAS\WorkflowEngine\Service
336  {
337  return new \ILIAS\WorkflowEngine\Service($this);
338  }
339 
340  public function mediaPool(): \ILIAS\MediaPool\Service
341  {
342  return new \ILIAS\MediaPool\Service($this);
343  }
344 
345  public function notes(): \ILIAS\Notes\Service
346  {
347  return new \ILIAS\Notes\Service($this);
348  }
349 
350  public function glossary(): \ILIAS\Glossary\Service
351  {
352  return new \ILIAS\Glossary\Service($this);
353  }
354 
355  public function portfolio(): \ILIAS\Portfolio\Service
356  {
357  return new \ILIAS\Portfolio\Service($this);
358  }
359 
360  public function blog(): \ILIAS\Blog\Service
361  {
362  return new \ILIAS\Blog\Service($this);
363  }
364 
365  public function mediaCast(): \ILIAS\MediaCast\Service
366  {
367  return new \ILIAS\MediaCast\Service($this);
368  }
369 
370  public function itemGroup(): \ILIAS\ItemGroup\Service
371  {
372  return new \ILIAS\ItemGroup\Service($this);
373  }
374 
375  public function htmlLearningModule(): \ILIAS\HTMLLearningModule\Service
376  {
377  return new \ILIAS\HTMLLearningModule\Service($this);
378  }
379 
380  public function awareness(): \ILIAS\Awareness\Service
381  {
382  return new \ILIAS\Awareness\Service($this);
383  }
384 
385  public function export(): \ILIAS\Export\Service
386  {
387  return new \ILIAS\Export\Service();
388  }
389 
390  public function personalWorkspace(): \ILIAS\PersonalWorkspace\Service
391  {
392  return new \ILIAS\PersonalWorkspace\Service();
393  }
394 
395  public function taxonomy(): \ILIAS\Taxonomy\Service
396  {
397  return new \ILIAS\Taxonomy\Service($this);
398  }
399 
400  public function infoScreen(): \ILIAS\InfoScreen\Service
401  {
402  return new \ILIAS\InfoScreen\Service($this);
403  }
404 
406  {
407  if ($this->file_service_settings === null) {
408  $this->file_service_settings = new \ilFileServicesSettings(
409  $this->settings(),
410  $this->clientIni(),
411  $this->database()
412  );
413  }
415  }
416 
417 
418  public function archives(): Archives
419  {
420  return new Archives();
421  }
422 
426  public function legacyArchives(): LegacyArchives
427  {
428  return new LegacyArchives();
429  }
430 
431  public function fileConverters(): Converters
432  {
433  return new Converters();
434  }
435 
436  public function contentStyle(): \ILIAS\Style\Content\Service
437  {
438  return new \ILIAS\Style\Content\Service($this);
439  }
440 
441  public function notifications(): \ILIAS\Notifications\Service
442  {
443  return new \ILIAS\Notifications\Service($this);
444  }
445 
446  public function cron(): \ILIAS\Cron\CronServices
447  {
448  return new \ILIAS\Cron\Services\ServicesImpl($this);
449  }
450 
451  public function mail(): \ILIAS\Mail\Service\MailService
452  {
453  return new \ILIAS\Mail\Service\MailService($this);
454  }
455 
456  public function certificate(): \ILIAS\Certificate\Service\CertificateService
457  {
458  return new \ILIAS\Certificate\Service\CertificateService($this);
459  }
460 
462  {
463  return $this['file_delivery'];
464  }
465 
466  public function learningObjectMetadata(): \ILIAS\MetaData\Services\ServicesInterface
467  {
468  return $this['learning_object_metadata'] ?? new \ILIAS\MetaData\Services\Services($this);
469  }
470 
471  public function like(): \ILIAS\Like\Service
472  {
473  return new \ILIAS\Like\Service($this);
474  }
475 
476 
494  public function isDependencyAvailable(string $name): bool
495  {
496  try {
497  $this->$name();
498  } catch (\InvalidArgumentException $e) {
499  return false;
500  } catch (\TypeError $e) {
501  return false;
502  }
503 
504  return true;
505  }
506 }
Global event handler.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:494
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.
Interface Observer Contains several chained tasks and infos about them.
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...
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:87
conditions()
Get conditions service.
Definition: Container.php:206
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
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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:24
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
Builds data types.
Definition: Factory.php:35
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
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
settings()
Get the interface to the settings.
Definition: Container.php:135