ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 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 ()
 
 testQuestion ()
 
 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 ()
 
 like ()
 
 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.

80 {
81 return $this["ilAccess"];
82 }
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...

Referenced by ILIAS\Awareness\User\ProviderCurrentCourse\__construct(), ILIAS\DI\Container\learningHistory(), and ILIAS\DI\Container\task().

+ Here is the caller graph for this function:

◆ archives()

ILIAS\DI\Container::archives ( )

Definition at line 418 of file Container.php.

418 : Archives
419 {
420 return new Archives();
421 }

◆ awareness()

ILIAS\DI\Container::awareness ( )

Definition at line 380 of file Container.php.

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

◆ backgroundTasks()

ILIAS\DI\Container::backgroundTasks ( )

Definition at line 158 of file Container.php.

158 : BackgroundTaskServices
159 {
160 return new BackgroundTaskServices($this);
161 }

◆ blog()

ILIAS\DI\Container::blog ( )

Definition at line 360 of file Container.php.

361 {
362 return new \ILIAS\Blog\Service($this);
363 }

◆ bookingManager()

ILIAS\DI\Container::bookingManager ( )

Definition at line 255 of file Container.php.

256 {
257 return new \ILIAS\BookingManager\Service($this);
258 }

◆ category()

ILIAS\DI\Container::category ( )

Definition at line 285 of file Container.php.

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

◆ certificate()

ILIAS\DI\Container::certificate ( )

Definition at line 456 of file Container.php.

457 {
458 return new \ILIAS\Certificate\Service\CertificateService($this);
459 }

◆ clientIni()

ILIAS\DI\Container::clientIni ( )

Definition at line 188 of file Container.php.

188 : \ilIniFile
189 {
190 return $this['ilClientIniFile'];
191 }
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...

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

+ Here is the caller graph for this function:

◆ conditions()

ILIAS\DI\Container::conditions ( )

Get conditions service.

Definition at line 206 of file Container.php.

207 {
208 return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
209 }

◆ container()

ILIAS\DI\Container::container ( )

Definition at line 275 of file Container.php.

276 {
277 return new \ILIAS\Container\Service($this);
278 }

◆ containerReference()

ILIAS\DI\Container::containerReference ( )

Definition at line 280 of file Container.php.

281 {
282 return new \ILIAS\ContainerReference\Service($this);
283 }

◆ contentStyle()

ILIAS\DI\Container::contentStyle ( )

Definition at line 436 of file Container.php.

437 {
438 return new \ILIAS\Style\Content\Service($this);
439 }

◆ copage()

ILIAS\DI\Container::copage ( )

Definition at line 300 of file Container.php.

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

◆ cron()

ILIAS\DI\Container::cron ( )

Definition at line 446 of file Container.php.

447 {
448 return new \ILIAS\Cron\Services\ServicesImpl($this);
449 }

◆ ctrl()

◆ 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 232 of file Container.php.

233 {
234 return new \ILIAS\Exercise\Service();
235 }

◆ export()

ILIAS\DI\Container::export ( )

Definition at line 385 of file Container.php.

386 {
387 return new \ILIAS\Export\Service();
388 }

◆ fileConverters()

ILIAS\DI\Container::fileConverters ( )

Definition at line 431 of file Container.php.

431 : Converters
432 {
433 return new Converters();
434 }

◆ fileDelivery()

ILIAS\DI\Container::fileDelivery ( )

Definition at line 461 of file Container.php.

462 {
463 return $this['file_delivery'];
464 }

◆ fileServiceSettings()

ILIAS\DI\Container::fileServiceSettings ( )

Definition at line 405 of file Container.php.

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 }
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

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

+ 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.

145 {
146 return $this['filesystem'];
147 }
The Filesystems interface defines the access methods which can be used to fetch the different filesys...
Definition: Filesystems.php:30

◆ folder()

ILIAS\DI\Container::folder ( )

Definition at line 290 of file Container.php.

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

◆ 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.

165 {
166 return $this['global_screen'];
167 }

◆ glossary()

ILIAS\DI\Container::glossary ( )

Definition at line 350 of file Container.php.

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

◆ 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 375 of file Container.php.

376 {
377 return new \ILIAS\HTMLLearningModule\Service($this);
378 }

◆ http()

ILIAS\DI\Container::http ( )
Returns
\ILIAS\HTTP\Services

Definition at line 173 of file Container.php.

174 {
175 return $this['http'];
176 }
Class Services.
Definition: Services.php:38

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

+ Here is the caller graph for this function:

◆ iliasIni()

ILIAS\DI\Container::iliasIni ( )

Definition at line 183 of file Container.php.

183 : \ilIniFile
184 {
185 return $this['ilIliasIniFile'];
186 }

◆ infoScreen()

ILIAS\DI\Container::infoScreen ( )

Definition at line 400 of file Container.php.

401 {
402 return new \ILIAS\InfoScreen\Service($this);
403 }

◆ 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 494 of file Container.php.

494 : 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 }

References Vendor\Package\$e.

◆ itemGroup()

ILIAS\DI\Container::itemGroup ( )

Definition at line 370 of file Container.php.

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

◆ language()

ILIAS\DI\Container::language ( )

Get interface to the i18n service.

Definition at line 95 of file Container.php.

96 {
97 return $this["lng"];
98 }
language handling

Referenced by ILIAS\Awareness\User\ProviderAllUsers\__construct(), ILIAS\Awareness\User\ProviderCourseContacts\__construct(), ILIAS\Awareness\User\ProviderCurrentCourse\__construct(), ILIAS\Awareness\User\ProviderMemberships\__construct(), ILIAS\Awareness\User\ProviderSystemContacts\__construct(), ilAwarenessUserProviderApprovedContacts\__construct(), ilAwarenessUserProviderContactRequests\__construct(), ilAccessibilitySupportFooterProvider\__construct(), ILIAS\OnScreenChat\Provider\OnScreenChatProvider\__construct(), ilCertificateCron\__construct(), ILIAS\Repository\Provider\RepositoryMainBarProvider\getHomeItem(), ILIAS\Mail\Provider\MailMainBarProvider\getStaticSubItems(), ILIAS\News\Provider\NewsMainBarProvider\getStaticSubItems(), ILIAS\Notes\Provider\NotesMainBarProvider\getStaticSubItems(), ILIAS\PersonalWorkspace\Provider\WorkspaceMainBarProvider\getStaticSubItems(), ILIAS\Portfolio\Provider\PortfolioMainBarProvider\getStaticSubItems(), ILIAS\Tasks\DerivedTasks\Provider\DerivedTaskMainBarProvider\getStaticSubItems(), ilDataCollectionExportOptionsXLSX\init(), ilExportExportOptionXML\init(), ilForumExportOptionHTML\init(), ilGlossaryExportOptionHTML\init(), ilHTLMExportOptionHTML\init(), ilLearningModuleExportOptionHTML\init(), ilLearningModuleExportOptionXML\init(), ilMediaPoolExportOptionXMLMaster\init(), ilMediaPoolExportOptionXMLMasterNoMedia\init(), ilOrgUnitExportOptionXLS\init(), ilOrgUnitExportOptionXML\init(), ilWikiExportOptionHTML\init(), ilWikiExportOptionHTMLWithComments\init(), ILIAS\DI\Container\learningHistory(), and ILIAS\DI\Container\task().

+ Here is the caller graph for this function:

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )

Definition at line 211 of file Container.php.

212 {
213 return new \ilLearningHistoryService(
214 $this->user(),
215 $this->language(),
216 $this->ui(),
217 $this->access(),
218 $this->repositoryTree()
219 );
220 }
access()
Get interface for access checks.
Definition: Container.php:79
user()
Get the current user.
Definition: Container.php:71
language()
Get interface to the i18n service.
Definition: Container.php:95
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:87
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ learningModule()

ILIAS\DI\Container::learningModule ( )

Definition at line 305 of file Container.php.

306 {
307 return new \ILIAS\LearningModule\Service($this);
308 }

◆ learningObjectMetadata()

ILIAS\DI\Container::learningObjectMetadata ( )

Definition at line 466 of file Container.php.

467 {
468 return $this['learning_object_metadata'] ?? new \ILIAS\MetaData\Services\Services($this);
469 }

◆ legacyArchives()

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

Definition at line 426 of file Container.php.

426 : LegacyArchives
427 {
428 return new LegacyArchives();
429 }

◆ like()

ILIAS\DI\Container::like ( )

Definition at line 471 of file Container.php.

472 {
473 return new \ILIAS\Like\Service($this);
474 }

◆ logger()

ILIAS\DI\Container::logger ( )

Get interface to get interfaces to different loggers.

Reimplemented in ilSystemStyleDICMock.

Definition at line 103 of file Container.php.

104 {
105 return new LoggingServices($this);
106 }
Provides fluid interface to LoggingServices.

◆ mail()

ILIAS\DI\Container::mail ( )

Definition at line 451 of file Container.php.

452 {
453 return new \ILIAS\Mail\Service\MailService($this);
454 }

◆ mediaCast()

ILIAS\DI\Container::mediaCast ( )

Definition at line 365 of file Container.php.

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

◆ mediaObjects()

ILIAS\DI\Container::mediaObjects ( )

Definition at line 315 of file Container.php.

316 {
317 return new \ILIAS\MediaObjects\Service($this);
318 }

◆ mediaPool()

ILIAS\DI\Container::mediaPool ( )

Definition at line 340 of file Container.php.

341 {
342 return new \ILIAS\MediaPool\Service($this);
343 }

◆ news()

ILIAS\DI\Container::news ( )

Definition at line 222 of file Container.php.

223 {
224 return new \ILIAS\News\Service($this);
225 }

◆ notes()

ILIAS\DI\Container::notes ( )

Definition at line 345 of file Container.php.

346 {
347 return new \ILIAS\Notes\Service($this);
348 }

◆ notifications()

ILIAS\DI\Container::notifications ( )

Definition at line 441 of file Container.php.

442 {
443 return new \ILIAS\Notifications\Service($this);
444 }

◆ object()

ILIAS\DI\Container::object ( )

Definition at line 227 of file Container.php.

228 {
229 return new \ilObjectService();
230 }

◆ personalWorkspace()

ILIAS\DI\Container::personalWorkspace ( )

Definition at line 390 of file Container.php.

391 {
392 return new \ILIAS\PersonalWorkspace\Service();
393 }

◆ portfolio()

ILIAS\DI\Container::portfolio ( )

Definition at line 355 of file Container.php.

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

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Definition at line 55 of file Container.php.

56 {
57 return new RBACServices($this);
58 }
Provides fluid interface to RBAC services.

Referenced by ILIAS\Awareness\User\ProviderCurrentCourse\__construct(), ILIAS\Chatroom\Provider\ChatMainBarProvider\getStaticSubItems(), and ILIAS\Mail\Provider\MailMainBarProvider\getStaticSubItems().

+ Here is the caller graph for this function:

◆ refinery()

ILIAS\DI\Container::refinery ( )

Definition at line 243 of file Container.php.

244 {
245 return $this['refinery'];
246 }
Builds data types.
Definition: Factory.php:36

Referenced by ILIAS\AdministrativeNotification\GlobalScreen\ADNProvider\__construct().

+ Here is the caller graph for this function:

◆ repository()

ILIAS\DI\Container::repository ( )

Definition at line 270 of file Container.php.

270 : Repository\Service
271 {
272 return new Repository\Service($this);
273 }

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

+ 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.

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...

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

+ Here is the caller graph for this function:

◆ resourceStorage()

ILIAS\DI\Container::resourceStorage ( )

Definition at line 265 of file Container.php.

266 {
267 return $this['resource_storage'];
268 }

◆ rootFolder()

ILIAS\DI\Container::rootFolder ( )

Definition at line 295 of file Container.php.

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

◆ settings()

◆ skills()

ILIAS\DI\Container::skills ( )

◆ survey()

ILIAS\DI\Container::survey ( )

Definition at line 320 of file Container.php.

321 {
322 return new \ILIAS\Survey\Service();
323 }

◆ surveyQuestionPool()

ILIAS\DI\Container::surveyQuestionPool ( )

Definition at line 325 of file Container.php.

326 {
327 return new \ILIAS\SurveyQuestionPool\Service($this);
328 }

◆ 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.

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...

◆ task()

ILIAS\DI\Container::task ( )

Definition at line 237 of file Container.php.

238 {
239 return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
240 }

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

+ Here is the call graph for this function:

◆ taxonomy()

ILIAS\DI\Container::taxonomy ( )

Definition at line 395 of file Container.php.

396 {
397 return new \ILIAS\Taxonomy\Service($this);
398 }

◆ testQuestion()

ILIAS\DI\Container::testQuestion ( )

Definition at line 330 of file Container.php.

331 {
332 return new \ILIAS\TestQuestionPool\Questions\PublicInterface($this);
333 }

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Definition at line 111 of file Container.php.

112 {
113 return $this["ilToolbar"];
114 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ ui()

ILIAS\DI\Container::ui ( )

Get the interface to get services from UI framework.

Definition at line 127 of file Container.php.

128 {
129 return new UIServices($this);
130 }
Provides fluid interface to RBAC services.
Definition: UIServices.php:25

Referenced by ilMStListCompetencesGUI\__construct(), ILIAS\Chatroom\Provider\ChatMainBarProvider\getStaticSubItems(), ILIAS\MyStaff\Provider\StaffMainBarProvider\getStaticSubItems(), ILIAS\DI\Container\learningHistory(), ILIAS\DI\Container\task(), and ILIAS\DI\Container\uiService().

+ Here is the caller graph for this function:

◆ uiService()

ILIAS\DI\Container::uiService ( )

Definition at line 249 of file Container.php.

250 {
251 return new \ilUIService($this->http()->request(), $this->ui());
252 }
Filter service.

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

+ 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.

154 {
155 return $this['upload'];
156 }

◆ user()

◆ wiki()

ILIAS\DI\Container::wiki ( )

Definition at line 310 of file Container.php.

311 {
312 return new \ILIAS\Wiki\Service($this);
313 }

◆ workflowEngine()

ILIAS\DI\Container::workflowEngine ( )

Definition at line 335 of file Container.php.

335 : \ILIAS\WorkflowEngine\Service
336 {
337 return new \ILIAS\WorkflowEngine\Service($this);
338 }

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: