ILIAS  release_8 Revision v8.24
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...
 
 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 ()
 
 fileServiceSettings ()
 
 contentStyle ()
 
 notifications ()
 
 cron ()
 
 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 31 of file Container.php.

Member Function Documentation

◆ access()

ILIAS\DI\Container::access ( )

Get interface for access checks.

Definition at line 70 of file Container.php.

71 {
72 return $this["ilAccess"];
73 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the caller graph for this function:

◆ awareness()

ILIAS\DI\Container::awareness ( )

Definition at line 381 of file Container.php.

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

◆ backgroundTasks()

ILIAS\DI\Container::backgroundTasks ( )

Definition at line 149 of file Container.php.

149 : BackgroundTaskServices
150 {
151 return new BackgroundTaskServices($this);
152 }

◆ blog()

ILIAS\DI\Container::blog ( )

Definition at line 361 of file Container.php.

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

◆ bookingManager()

ILIAS\DI\Container::bookingManager ( )

Definition at line 251 of file Container.php.

252 {
253 return new \ILIAS\BookingManager\Service($this);
254 }

◆ category()

ILIAS\DI\Container::category ( )

Definition at line 281 of file Container.php.

282 {
283 return new \ILIAS\Category\Service($this);
284 }

◆ clientIni()

ILIAS\DI\Container::clientIni ( )

Definition at line 179 of file Container.php.

179 : \ilIniFile
180 {
181 return $this['ilClientIniFile'];
182 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

203 {
204 return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
205 }
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 271 of file Container.php.

272 {
273 return new \ILIAS\Container\Service($this);
274 }

◆ containerReference()

ILIAS\DI\Container::containerReference ( )

Definition at line 276 of file Container.php.

277 {
278 return new \ILIAS\ContainerReference\Service($this);
279 }

◆ contentStyle()

ILIAS\DI\Container::contentStyle ( )

Definition at line 398 of file Container.php.

399 {
400 return new \ILIAS\Style\Content\Service($this);
401 }

◆ copage()

ILIAS\DI\Container::copage ( )

Definition at line 296 of file Container.php.

297 {
298 return new \ILIAS\COPage\Service($this);
299 }

◆ cron()

ILIAS\DI\Container::cron ( )

Definition at line 408 of file Container.php.

409 {
410 return new \ilCronServicesImpl($this);
411 }

◆ ctrl()

ILIAS\DI\Container::ctrl ( )

Get the interface to the control structure.

Definition at line 54 of file Container.php.

55 {
56 return $this["ilCtrl"];
57 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilNotificationGUI\__construct(), ilTestCorrectionsGUI\__construct(), ILIAS\Membership\GlobalScreen\MembershipMainBarProvider\getStaticSubItems(), ILIAS\Notes\Provider\NotesMainBarProvider\getStaticSubItems(), and ILIAS\Tasks\DerivedTasks\Provider\DerivedTaskMainBarProvider\getStaticSubItems().

+ Here is the caller graph for this function:

◆ database()

◆ event()

ILIAS\DI\Container::event ( )

Definition at line 169 of file Container.php.

170 {
171 return $this['ilAppEventHandler'];
172 }
Global event handler.

◆ exercise()

ILIAS\DI\Container::exercise ( )

Definition at line 228 of file Container.php.

229 {
230 return new \ILIAS\Exercise\Service();
231 }

◆ fileServiceSettings()

ILIAS\DI\Container::fileServiceSettings ( )

Definition at line 386 of file Container.php.

387 {
388 if ($this->file_service_settings === null) {
389 $this->file_service_settings = new \ilFileServicesSettings(
390 $this->settings(),
391 $this->clientIni(),
392 $this->database()
393 );
394 }
396 }
database()
Get interface to the Database.
Definition: Container.php:38
ilFileServicesSettings $file_service_settings
Definition: Container.php:33
settings()
Get the interface to the settings.
Definition: Container.php:126
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

136 {
137 return $this['filesystem'];
138 }

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

+ Here is the caller graph for this function:

◆ folder()

ILIAS\DI\Container::folder ( )

Definition at line 286 of file Container.php.

287 {
288 return new \ILIAS\Folder\Service($this);
289 }

◆ globalScreen()

ILIAS\DI\Container::globalScreen ( )

Definition at line 155 of file Container.php.

156 {
157 return $this['global_screen'];
158 }

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

+ Here is the caller graph for this function:

◆ glossary()

ILIAS\DI\Container::glossary ( )

Definition at line 351 of file Container.php.

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

◆ help()

ILIAS\DI\Container::help ( )

Definition at line 189 of file Container.php.

189 : \ilHelpGUI
190 {
191 return $this['ilHelp'];
192 }
Help GUI class.

Referenced by ilTestCorrectionsGUI\__construct().

+ Here is the caller graph for this function:

◆ htmlLearningModule()

ILIAS\DI\Container::htmlLearningModule ( )

Definition at line 376 of file Container.php.

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

◆ http()

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

Definition at line 164 of file Container.php.

165 {
166 return $this['http'];
167 }
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 174 of file Container.php.

174 : \ilIniFile
175 {
176 return $this['ilIliasIniFile'];
177 }

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

430 : bool
431 {
432 try {
433 $this->$name();
434 } catch (\InvalidArgumentException $e) {
435 return false;
436 } catch (\TypeError $e) {
437 return false;
438 }
439
440 return true;
441 }
if($format !==null) $name
Definition: metadata.php:247

References Vendor\Package\$e, and $name.

◆ itemGroup()

ILIAS\DI\Container::itemGroup ( )

Definition at line 371 of file Container.php.

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

◆ language()

ILIAS\DI\Container::language ( )

Get interface to the i18n service.

Definition at line 86 of file Container.php.

87 {
88 return $this["lng"];
89 }
language handling

Referenced by ilCertificateCron\__construct(), ilNotificationGUI\__construct(), 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(), ILIAS\Services\User\UserFieldAttributesChangeListener\__construct(), ILIAS\OnScreenChat\Provider\OnScreenChatProvider\__construct(), ilTestCorrectionsGUI\__construct(), ILIAS\Repository\Provider\RepositoryMainBarProvider\getHomeItem(), ILIAS\Container\Screen\MemberViewLayoutProvider\getMemberViewModeInfo(), ILIAS\Portfolio\Provider\PortfolioMainBarProvider\getStaticSubItems(), ILIAS\Mail\Provider\MailMainBarProvider\getStaticSubItems(), ILIAS\News\Provider\NewsMainBarProvider\getStaticSubItems(), ILIAS\Notes\Provider\NotesMainBarProvider\getStaticSubItems(), ILIAS\PersonalWorkspace\Provider\WorkspaceMainBarProvider\getStaticSubItems(), ILIAS\Tasks\DerivedTasks\Provider\DerivedTaskMainBarProvider\getStaticSubItems(), ILIAS\DI\Container\learningHistory(), ILIAS\DI\Container\news(), ILIAS\DI\Container\object(), and ILIAS\DI\Container\task().

+ Here is the caller graph for this function:

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )

Definition at line 207 of file Container.php.

208 {
209 return new \ilLearningHistoryService(
210 $this->user(),
211 $this->language(),
212 $this->ui(),
213 $this->access(),
214 $this->repositoryTree()
215 );
216 }
access()
Get interface for access checks.
Definition: Container.php:70
user()
Get the current user.
Definition: Container.php:62
language()
Get interface to the i18n service.
Definition: Container.php:86
ui()
Get the interface to get services from UI framework.
Definition: Container.php:118
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:78
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 301 of file Container.php.

302 {
303 return new \ILIAS\LearningModule\Service($this);
304 }

◆ logger()

ILIAS\DI\Container::logger ( )

Get interface to get interfaces to different loggers.

Reimplemented in ilSystemStyleDICMock.

Definition at line 94 of file Container.php.

95 {
96 return new LoggingServices($this);
97 }
Provides fluid interface to LoggingServices.

◆ mediaCast()

ILIAS\DI\Container::mediaCast ( )

Definition at line 366 of file Container.php.

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

◆ mediaObjects()

ILIAS\DI\Container::mediaObjects ( )

Definition at line 311 of file Container.php.

312 {
313 return new \ILIAS\MediaObjects\Service($this);
314 }

◆ mediaPool()

ILIAS\DI\Container::mediaPool ( )

Definition at line 341 of file Container.php.

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

◆ news()

ILIAS\DI\Container::news ( )

Definition at line 218 of file Container.php.

219 {
220 return new \ilNewsService($this->language(), $this->settings(), $this->user());
221 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ notes()

ILIAS\DI\Container::notes ( )

Definition at line 346 of file Container.php.

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

◆ notifications()

ILIAS\DI\Container::notifications ( )

Definition at line 403 of file Container.php.

404 {
405 return new \ILIAS\Notifications\Service($this);
406 }

◆ object()

ILIAS\DI\Container::object ( )

Definition at line 223 of file Container.php.

224 {
225 return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
226 }
filesystem()
Get the Filesystem service interface.
Definition: Container.php:135
upload()
Gets the file upload interface.
Definition: Container.php:144

References ILIAS\DI\Container\filesystem(), ILIAS\DI\Container\language(), ILIAS\DI\Container\settings(), and ILIAS\DI\Container\upload().

+ Here is the call graph for this function:

◆ portfolio()

ILIAS\DI\Container::portfolio ( )

Definition at line 356 of file Container.php.

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

◆ question()

ILIAS\DI\Container::question ( )

Definition at line 194 of file Container.php.

195 {
196 return new \ilAsqFactory();
197 }

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Definition at line 46 of file Container.php.

47 {
48 return new RBACServices($this);
49 }
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 239 of file Container.php.

240 {
241 return $this['refinery'];
242 }
Builds data types.
Definition: Factory.php:21

Referenced by ilTestCorrectionsGUI\__construct().

+ Here is the caller graph for this function:

◆ repository()

ILIAS\DI\Container::repository ( )

Definition at line 266 of file Container.php.

266 : Repository\Service
267 {
268 return new Repository\Service($this);
269 }

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

78 : \ilTree
79 {
80 return $this["tree"];
81 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the caller graph for this function:

◆ resourceStorage()

ILIAS\DI\Container::resourceStorage ( )

Definition at line 261 of file Container.php.

262 {
263 return $this['resource_storage'];
264 }

◆ rootFolder()

ILIAS\DI\Container::rootFolder ( )

Definition at line 291 of file Container.php.

292 {
293 return new \ILIAS\RootFolder\Service($this);
294 }

◆ settings()

◆ skills()

ILIAS\DI\Container::skills ( )

Definition at line 256 of file Container.php.

257 {
258 return new SkillService();
259 }

◆ survey()

ILIAS\DI\Container::survey ( )

Definition at line 316 of file Container.php.

317 {
318 return new \ILIAS\Survey\Service();
319 }

◆ surveyQuestionPool()

ILIAS\DI\Container::surveyQuestionPool ( )

Definition at line 321 of file Container.php.

322 {
323 return new \ILIAS\SurveyQuestionPool\Service($this);
324 }

◆ systemStyle()

ILIAS\DI\Container::systemStyle ( )

Definition at line 184 of file Container.php.

185 {
186 return $this['styleDefinition'];
187 }
ilStyleDefinition acts as a wrapper of style related actions.

◆ tabs()

ILIAS\DI\Container::tabs ( )

Get interface to the tabs.

Definition at line 110 of file Container.php.

110 : \ilTabsGUI
111 {
112 return $this["ilTabs"];
113 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilTestCorrectionsGUI\__construct().

+ Here is the caller graph for this function:

◆ task()

ILIAS\DI\Container::task ( )

Definition at line 233 of file Container.php.

234 {
235 return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
236 }

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:

◆ test()

ILIAS\DI\Container::test ( )

Definition at line 326 of file Container.php.

327 {
328 return new \ILIAS\Test\Service($this);
329 }

◆ testQuestionPool()

ILIAS\DI\Container::testQuestionPool ( )

Definition at line 331 of file Container.php.

332 {
333 return new \ILIAS\TestQuestionPool\Service($this);
334 }

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Definition at line 102 of file Container.php.

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

◆ ui()

◆ uiService()

ILIAS\DI\Container::uiService ( )

Definition at line 245 of file Container.php.

246 {
247 return new \ilUIService($this->http()->request(), $this->ui());
248 }
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 144 of file Container.php.

145 {
146 return $this['upload'];
147 }

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

+ Here is the caller graph for this function:

◆ user()

◆ wiki()

ILIAS\DI\Container::wiki ( )

Definition at line 306 of file Container.php.

307 {
308 return new \ILIAS\Wiki\Service($this);
309 }

◆ workflowEngine()

ILIAS\DI\Container::workflowEngine ( )

Definition at line 336 of file Container.php.

337 {
338 return new \ILIAS\WorkflowEngine\Service($this);
339 }

Field Documentation

◆ $file_service_settings

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

Definition at line 33 of file Container.php.

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


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