ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
ILIAS\DI\Container Class Reference

Customizing of pimple-DIC for ILIAS. More...

+ Inheritance diagram for ILIAS\DI\Container:
+ Collaboration diagram for ILIAS\DI\Container:

Public Member Functions

 database ()
 Get interface to the Database. More...
 
 globalCache ()
 
 rbac ()
 Get interface to get interfaces to all things rbac. More...
 
 ctrl ()
 Get the interface to the control structure. More...
 
 user ()
 Get the current user. More...
 
 access ()
 Get interface for access checks. More...
 
 repositoryTree ()
 Get interface to the repository tree. More...
 
 language ()
 Get interface to the i18n service. More...
 
 logger ()
 Get interface to get interfaces to different loggers. More...
 
 toolbar ()
 Get interface to the toolbar. More...
 
 tabs ()
 Get interface to the tabs. More...
 
 ui ()
 Get the interface to get services from UI framework. More...
 
 settings ()
 Get the interface to the settings. More...
 
 filesystem ()
 Get the Filesystem service interface. More...
 
 upload ()
 Gets the file upload interface. More...
 
 backgroundTasks ()
 
 globalScreen ()
 
 http ()
 
 event ()
 
 iliasIni ()
 
 clientIni ()
 
 systemStyle ()
 
 help ()
 
 question ()
 
 conditions ()
 Get conditions service. More...
 
 learningHistory ()
 
 news ()
 
 object ()
 
 exercise ()
 
 task ()
 
 refinery ()
 
 uiService ()
 
 bookingManager ()
 
 skills ()
 
 resourceStorage ()
 
 repository ()
 
 container ()
 
 containerReference ()
 
 category ()
 
 folder ()
 
 rootFolder ()
 
 copage ()
 
 learningModule ()
 
 wiki ()
 
 mediaObjects ()
 
 survey ()
 
 surveyQuestionPool ()
 
 test ()
 
 testQuestionPool ()
 
 workflowEngine ()
 
 mediaPool ()
 
 notes ()
 
 glossary ()
 
 portfolio ()
 
 blog ()
 
 mediaCast ()
 
 itemGroup ()
 
 htmlLearningModule ()
 
 awareness ()
 
 export ()
 
 personalWorkspace ()
 
 taxonomy ()
 
 infoScreen ()
 
 fileServiceSettings ()
 
 archives ()
 
 legacyArchives ()
 
 fileConverters ()
 
 contentStyle ()
 
 notifications ()
 
 cron ()
 
 mail ()
 
 certificate ()
 
 fileDelivery ()
 
 learningObjectMetadata ()
 
 isDependencyAvailable (string $name)
 Note: Only use isDependencyAvailable if strictly required. More...
 

Private Attributes

ilFileServicesSettings $file_service_settings = null
 

Detailed Description

Customizing of pimple-DIC for ILIAS.

This just exposes some services in the container as plain methods to help IDEs when using ILIAS.

Definition at line 35 of file Container.php.

Member Function Documentation

◆ access()

ILIAS\DI\Container::access ( )

Get interface for access checks.

Definition at line 79 of file Container.php.

Referenced by ILIAS\DI\Container\learningHistory(), ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies(), and ILIAS\DI\Container\task().

80  {
81  return $this["ilAccess"];
82  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ archives()

ILIAS\DI\Container::archives ( )

Definition at line 428 of file Container.php.

428  : Archives
429  {
430  return new Archives();
431  }

◆ awareness()

ILIAS\DI\Container::awareness ( )

Definition at line 390 of file Container.php.

390  : \ILIAS\Awareness\Service
391  {
392  return new \ILIAS\Awareness\Service($this);
393  }

◆ backgroundTasks()

ILIAS\DI\Container::backgroundTasks ( )

Definition at line 158 of file Container.php.

Referenced by ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

158  : BackgroundTaskServices
159  {
160  return new BackgroundTaskServices($this);
161  }
+ Here is the caller graph for this function:

◆ blog()

ILIAS\DI\Container::blog ( )

Definition at line 370 of file Container.php.

371  {
372  return new \ILIAS\Blog\Service($this);
373  }

◆ bookingManager()

ILIAS\DI\Container::bookingManager ( )

Definition at line 260 of file Container.php.

260  : \ILIAS\BookingManager\Service
261  {
262  return new \ILIAS\BookingManager\Service($this);
263  }

◆ category()

ILIAS\DI\Container::category ( )

Definition at line 290 of file Container.php.

291  {
292  return new \ILIAS\Category\Service($this);
293  }

◆ certificate()

ILIAS\DI\Container::certificate ( )

Definition at line 466 of file Container.php.

466  : \ILIAS\Certificate\Service\CertificateService
467  {
468  return new \ILIAS\Certificate\Service\CertificateService($this);
469  }

◆ clientIni()

ILIAS\DI\Container::clientIni ( )

Definition at line 188 of file Container.php.

Referenced by ILIAS\DI\Container\fileServiceSettings().

188  : \ilIniFile
189  {
190  return $this['ilClientIniFile'];
191  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ conditions()

ILIAS\DI\Container::conditions ( )

Get conditions service.

Definition at line 211 of file Container.php.

212  {
213  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
214  }
Wraps ilObject dependencies.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ container()

ILIAS\DI\Container::container ( )

Definition at line 280 of file Container.php.

280  : \ILIAS\Container\Service
281  {
282  return new \ILIAS\Container\Service($this);
283  }

◆ containerReference()

ILIAS\DI\Container::containerReference ( )

Definition at line 285 of file Container.php.

286  {
287  return new \ILIAS\ContainerReference\Service($this);
288  }

◆ contentStyle()

ILIAS\DI\Container::contentStyle ( )

Definition at line 446 of file Container.php.

446  : \ILIAS\Style\Content\Service
447  {
448  return new \ILIAS\Style\Content\Service($this);
449  }

◆ copage()

ILIAS\DI\Container::copage ( )

Definition at line 305 of file Container.php.

305  : \ILIAS\COPage\Service
306  {
307  return new \ILIAS\COPage\Service($this);
308  }

◆ cron()

ILIAS\DI\Container::cron ( )

Definition at line 456 of file Container.php.

457  {
458  return new \ilCronServicesImpl($this);
459  }

◆ ctrl()

◆ database()

ILIAS\DI\Container::database ( )

◆ event()

ILIAS\DI\Container::event ( )

Definition at line 178 of file Container.php.

179  {
180  return $this['ilAppEventHandler'];
181  }
Global event handler.

◆ exercise()

ILIAS\DI\Container::exercise ( )

Definition at line 237 of file Container.php.

238  {
239  return new \ILIAS\Exercise\Service();
240  }

◆ export()

ILIAS\DI\Container::export ( )

Definition at line 395 of file Container.php.

396  {
397  return new \ILIAS\Export\Service();
398  }

◆ fileConverters()

ILIAS\DI\Container::fileConverters ( )

Definition at line 441 of file Container.php.

441  : Converters
442  {
443  return new Converters();
444  }

◆ fileDelivery()

ILIAS\DI\Container::fileDelivery ( )

Definition at line 471 of file Container.php.

472  {
473  return $this['file_delivery'];
474  }

◆ fileServiceSettings()

ILIAS\DI\Container::fileServiceSettings ( )

Definition at line 415 of file Container.php.

References ILIAS\DI\Container\$file_service_settings, ILIAS\DI\Container\clientIni(), ILIAS\DI\Container\database(), and ILIAS\DI\Container\settings().

416  {
417  if ($this->file_service_settings === null) {
418  $this->file_service_settings = new \ilFileServicesSettings(
419  $this->settings(),
420  $this->clientIni(),
421  $this->database()
422  );
423  }
425  }
database()
Get interface to the Database.
Definition: Container.php:42
ilFileServicesSettings $file_service_settings
Definition: Container.php:37
settings()
Get the interface to the settings.
Definition: Container.php:135
+ Here is the call graph for this function:

◆ filesystem()

ILIAS\DI\Container::filesystem ( )

Get the Filesystem service interface.

Definition at line 144 of file Container.php.

Referenced by ILIAS\Style\Content\InternalService\__construct().

144  : \ILIAS\Filesystem\Filesystems
145  {
146  return $this['filesystem'];
147  }
+ Here is the caller graph for this function:

◆ folder()

ILIAS\DI\Container::folder ( )

Definition at line 295 of file Container.php.

296  {
297  return new \ILIAS\Folder\Service($this);
298  }

◆ globalCache()

ILIAS\DI\Container::globalCache ( )

Definition at line 47 of file Container.php.

47  : Services
48  {
49  return $this["global_cache"] ?? new Services(null);
50  }

◆ globalScreen()

ILIAS\DI\Container::globalScreen ( )

Definition at line 164 of file Container.php.

Referenced by ILIAS\GlobalScreen\Provider\Provider\AbstractPluginProvider\__construct().

165  {
166  return $this['global_screen'];
167  }
Class Services.
Definition: Services.php:39
+ Here is the caller graph for this function:

◆ glossary()

ILIAS\DI\Container::glossary ( )

Definition at line 360 of file Container.php.

360  : \ILIAS\Glossary\Service
361  {
362  return new \ILIAS\Glossary\Service($this);
363  }

◆ help()

ILIAS\DI\Container::help ( )

Definition at line 198 of file Container.php.

198  : \ilHelpGUI
199  {
200  return $this['ilHelp'];
201  }
Help GUI class.

◆ htmlLearningModule()

ILIAS\DI\Container::htmlLearningModule ( )

Definition at line 385 of file Container.php.

386  {
387  return new \ILIAS\HTMLLearningModule\Service($this);
388  }

◆ http()

ILIAS\DI\Container::http ( )

◆ iliasIni()

ILIAS\DI\Container::iliasIni ( )

Definition at line 183 of file Container.php.

183  : \ilIniFile
184  {
185  return $this['ilIliasIniFile'];
186  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ infoScreen()

ILIAS\DI\Container::infoScreen ( )

Definition at line 410 of file Container.php.

411  {
412  return new \ILIAS\InfoScreen\Service($this);
413  }

◆ isDependencyAvailable()

ILIAS\DI\Container::isDependencyAvailable ( string  $name)

Note: Only use isDependencyAvailable if strictly required.

The need for this, mostly points to some underlying problem needing to be solved instead of using this. This was introduced as temporary workaround. See: https://github.com/ILIAS-eLearning/ILIAS/pull/1064

This is syntactic sugar for executing the try catch statement in the clients code. Note that the use of the offsetSet code of the default container should be avoided, since knowledge about the containers internal mechanism is injected.

Example: //This is bad since the client should not need to know about the id's name $DIC->offsetSet("styleDefinition")

//This is better, since the client just needs to know the name defined in the //interface of the component $DIC->isDependencyAvailable("systemStyle")

Definition at line 498 of file Container.php.

References Vendor\Package\$e.

498  : bool
499  {
500  try {
501  $this->$name();
502  } catch (\InvalidArgumentException $e) {
503  return false;
504  } catch (\TypeError $e) {
505  return false;
506  }
507 
508  return true;
509  }

◆ itemGroup()

ILIAS\DI\Container::itemGroup ( )

Definition at line 380 of file Container.php.

381  {
382  return new \ILIAS\ItemGroup\Service($this);
383  }

◆ language()

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )

Definition at line 216 of file Container.php.

References ILIAS\DI\Container\access(), ILIAS\DI\Container\language(), ILIAS\DI\Container\repositoryTree(), ILIAS\DI\Container\ui(), and ILIAS\DI\Container\user().

217  {
218  return new \ilLearningHistoryService(
219  $this->user(),
220  $this->language(),
221  $this->ui(),
222  $this->access(),
223  $this->repositoryTree()
224  );
225  }
user()
Get the current user.
Definition: Container.php:71
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
language()
Get interface to the i18n service.
Definition: Container.php:95
access()
Get interface for access checks.
Definition: Container.php:79
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
+ Here is the call graph for this function:

◆ learningModule()

ILIAS\DI\Container::learningModule ( )

Definition at line 310 of file Container.php.

310  : \ILIAS\LearningModule\Service
311  {
312  return new \ILIAS\LearningModule\Service($this);
313  }

◆ learningObjectMetadata()

ILIAS\DI\Container::learningObjectMetadata ( )

Definition at line 476 of file Container.php.

477  {
478  return new \ILIAS\MetaData\Services\Services($this);
479  }

◆ legacyArchives()

ILIAS\DI\Container::legacyArchives ( )
Deprecated:
Use archives() instead

Definition at line 436 of file Container.php.

436  : LegacyArchives
437  {
438  return new LegacyArchives();
439  }

◆ logger()

ILIAS\DI\Container::logger ( )

Get interface to get interfaces to different loggers.

Definition at line 103 of file Container.php.

Referenced by ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

104  {
105  return new LoggingServices($this);
106  }
Provides fluid interface to LoggingServices.
+ Here is the caller graph for this function:

◆ mail()

ILIAS\DI\Container::mail ( )

Definition at line 461 of file Container.php.

461  : \ILIAS\Mail\Service\MailService
462  {
463  return new \ILIAS\Mail\Service\MailService($this);
464  }

◆ mediaCast()

ILIAS\DI\Container::mediaCast ( )

Definition at line 375 of file Container.php.

375  : \ILIAS\MediaCast\Service
376  {
377  return new \ILIAS\MediaCast\Service($this);
378  }

◆ mediaObjects()

ILIAS\DI\Container::mediaObjects ( )

Definition at line 320 of file Container.php.

320  : \ILIAS\MediaObjects\Service
321  {
322  return new \ILIAS\MediaObjects\Service($this);
323  }

◆ mediaPool()

ILIAS\DI\Container::mediaPool ( )

Definition at line 350 of file Container.php.

351  {
352  return new \ILIAS\MediaPool\Service($this);
353  }

◆ news()

ILIAS\DI\Container::news ( )

Definition at line 227 of file Container.php.

227  : \ILIAS\News\Service
228  {
229  return new \ILIAS\News\Service($this);
230  }

◆ notes()

ILIAS\DI\Container::notes ( )

Definition at line 355 of file Container.php.

356  {
357  return new \ILIAS\Notes\Service($this);
358  }

◆ notifications()

ILIAS\DI\Container::notifications ( )

Definition at line 451 of file Container.php.

451  : \ILIAS\Notifications\Service
452  {
453  return new \ILIAS\Notifications\Service($this);
454  }

◆ object()

ILIAS\DI\Container::object ( )

Definition at line 232 of file Container.php.

233  {
234  return new \ilObjectService();
235  }

◆ personalWorkspace()

ILIAS\DI\Container::personalWorkspace ( )

Definition at line 400 of file Container.php.

401  {
402  return new \ILIAS\PersonalWorkspace\Service();
403  }

◆ portfolio()

ILIAS\DI\Container::portfolio ( )

Definition at line 365 of file Container.php.

366  {
367  return new \ILIAS\Portfolio\Service($this);
368  }

◆ question()

ILIAS\DI\Container::question ( )

Definition at line 203 of file Container.php.

203  : \ilAsqFactory
204  {
205  return new \ilAsqFactory();
206  }

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Definition at line 55 of file Container.php.

Referenced by ILIAS\Style\Content\InternalDomainService\__construct(), ILIAS\Mail\Provider\MailMainBarProvider\getStaticSubItems(), ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider\getStaticSubItems(), and ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

56  {
57  return new RBACServices($this);
58  }
Provides fluid interface to RBAC services.
+ Here is the caller graph for this function:

◆ refinery()

ILIAS\DI\Container::refinery ( )

Definition at line 248 of file Container.php.

Referenced by ILIAS\TestQuestionPool\InternalService\__construct(), and InitCtrlService\init().

249  {
250  return $this['refinery'];
251  }
Builds data types.
Definition: Factory.php:35
+ Here is the caller graph for this function:

◆ repository()

ILIAS\DI\Container::repository ( )

Definition at line 275 of file Container.php.

Referenced by ILIAS\Repository\Provider\RepositoryMainBarProvider\__construct().

275  : Repository\Service
276  {
277  return new Repository\Service($this);
278  }
+ Here is the caller graph for this function:

◆ repositoryTree()

ILIAS\DI\Container::repositoryTree ( )

Get interface to the repository tree.

Definition at line 87 of file Container.php.

Referenced by ILIAS\DI\Container\learningHistory(), and ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

87  : \ilTree
88  {
89  return $this["tree"];
90  }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the caller graph for this function:

◆ resourceStorage()

ILIAS\DI\Container::resourceStorage ( )

Definition at line 270 of file Container.php.

271  {
272  return $this['resource_storage'];
273  }

◆ rootFolder()

ILIAS\DI\Container::rootFolder ( )

Definition at line 300 of file Container.php.

301  {
302  return new \ILIAS\RootFolder\Service($this);
303  }

◆ settings()

◆ skills()

ILIAS\DI\Container::skills ( )

Definition at line 265 of file Container.php.

266  {
267  return new SkillService();
268  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ survey()

ILIAS\DI\Container::survey ( )

Definition at line 325 of file Container.php.

326  {
327  return new \ILIAS\Survey\Service();
328  }

◆ surveyQuestionPool()

ILIAS\DI\Container::surveyQuestionPool ( )

Definition at line 330 of file Container.php.

330  : \ILIAS\SurveyQuestionPool\Service
331  {
332  return new \ILIAS\SurveyQuestionPool\Service($this);
333  }

◆ systemStyle()

ILIAS\DI\Container::systemStyle ( )

Definition at line 193 of file Container.php.

194  {
195  return $this['styleDefinition'];
196  }
ilStyleDefinition acts as a wrapper of style related actions.

◆ tabs()

ILIAS\DI\Container::tabs ( )

Get interface to the tabs.

Definition at line 119 of file Container.php.

Referenced by ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

119  : \ilTabsGUI
120  {
121  return $this["ilTabs"];
122  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ task()

ILIAS\DI\Container::task ( )

Definition at line 242 of file Container.php.

References ILIAS\DI\Container\access(), ILIAS\DI\Container\language(), ILIAS\DI\Container\ui(), and ILIAS\DI\Container\user().

243  {
244  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
245  }
user()
Get the current user.
Definition: Container.php:71
language()
Get interface to the i18n service.
Definition: Container.php:95
access()
Get interface for access checks.
Definition: Container.php:79
Task service.
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
+ Here is the call graph for this function:

◆ taxonomy()

ILIAS\DI\Container::taxonomy ( )

Definition at line 405 of file Container.php.

405  : \ILIAS\Taxonomy\Service
406  {
407  return new \ILIAS\Taxonomy\Service($this);
408  }

◆ test()

ILIAS\DI\Container::test ( )

Definition at line 335 of file Container.php.

336  {
337  return new \ILIAS\Test\Service($this);
338  }

◆ testQuestionPool()

ILIAS\DI\Container::testQuestionPool ( )

Definition at line 340 of file Container.php.

340  : \ILIAS\TestQuestionPool\Service
341  {
342  return new \ILIAS\TestQuestionPool\Service($this);
343  }

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Definition at line 111 of file Container.php.

Referenced by ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

111  : \ilToolbarGUI
112  {
113  return $this["ilToolbar"];
114  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ ui()

◆ uiService()

ILIAS\DI\Container::uiService ( )

Definition at line 254 of file Container.php.

References ILIAS\DI\Container\http(), and ILIAS\DI\Container\ui().

254  : \ilUIService
255  {
256  return new \ilUIService($this->http()->request(), $this->ui());
257  }
Filter service.
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
+ Here is the call graph for this function:

◆ upload()

ILIAS\DI\Container::upload ( )

Gets the file upload interface.

Definition at line 153 of file Container.php.

Referenced by ILIAS\TestQuestionPool\InternalService\__construct(), and ILIAS\Style\Content\InternalService\__construct().

153  : \ILIAS\FileUpload\FileUpload
154  {
155  return $this['upload'];
156  }
+ Here is the caller graph for this function:

◆ user()

◆ wiki()

ILIAS\DI\Container::wiki ( )

Definition at line 315 of file Container.php.

315  : \ILIAS\Wiki\Service
316  {
317  return new \ILIAS\Wiki\Service($this);
318  }

◆ workflowEngine()

ILIAS\DI\Container::workflowEngine ( )

Definition at line 345 of file Container.php.

345  : \ILIAS\WorkflowEngine\Service
346  {
347  return new \ILIAS\WorkflowEngine\Service($this);
348  }

Field Documentation

◆ $file_service_settings

ilFileServicesSettings ILIAS\DI\Container::$file_service_settings = null
private

Definition at line 37 of file Container.php.

Referenced by ILIAS\DI\Container\fileServiceSettings().


The documentation for this class was generated from the following file: