ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 isDependencyAvailable ($name)
 Note: Only use isDependencyAvailable if strictly required. More...
 

Detailed Description

Customizing of pimple-DIC for ILIAS.

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

Definition at line 18 of file Container.php.

Member Function Documentation

◆ access()

ILIAS\DI\Container::access ( )

Get interface for access checks.

Returns

Definition at line 65 of file Container.php.

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

66  {
67  return $this["ilAccess"];
68  }
+ Here is the caller graph for this function:

◆ backgroundTasks()

ILIAS\DI\Container::backgroundTasks ( )
Returns
BackgroundTaskServices

Definition at line 166 of file Container.php.

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

167  {
168  return new BackgroundTaskServices($this);
169  }
+ Here is the caller graph for this function:

◆ bookingManager()

ILIAS\DI\Container::bookingManager ( )
Returns

Definition at line 315 of file Container.php.

316  {
317  return new \ilBookingManagerService();
318  }

◆ clientIni()

ILIAS\DI\Container::clientIni ( )
Returns

Definition at line 208 of file Container.php.

209  {
210  return $this['ilClientIniFile'];
211  }

◆ conditions()

ILIAS\DI\Container::conditions ( )

Get conditions service.

Returns

Definition at line 242 of file Container.php.

243  {
244  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
245  }
Wraps ilObject dependencies.

◆ ctrl()

ILIAS\DI\Container::ctrl ( )

Get the interface to the control structure.

Returns

Definition at line 45 of file Container.php.

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

46  {
47  return $this["ilCtrl"];
48  }
+ Here is the caller graph for this function:

◆ database()

ILIAS\DI\Container::database ( )

Get interface to the Database.

Returns

Definition at line 25 of file Container.php.

Referenced by ILIAS\OnScreenChat\Provider\OnScreenChatNotificationProvider\__construct(), and ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap\resolveBaseDependencies().

26  {
27  return $this["ilDB"];
28  }
+ Here is the caller graph for this function:

◆ event()

ILIAS\DI\Container::event ( )
Returns

Definition at line 192 of file Container.php.

193  {
194  return $this['ilAppEventHandler'];
195  }

◆ exercise()

ILIAS\DI\Container::exercise ( )
Returns

Definition at line 280 of file Container.php.

281  {
282  return new \ilExerciseFactory();
283  }

◆ filesystem()

ILIAS\DI\Container::filesystem ( )

Get the Filesystem service interface.

Returns
Filesystems

Definition at line 146 of file Container.php.

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

147  {
148  return $this['filesystem'];
149  }
+ Here is the caller graph for this function:

◆ globalScreen()

ILIAS\DI\Container::globalScreen ( )
Returns
Services

Definition at line 175 of file Container.php.

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

176  {
177  return $this['global_screen'];
178  }
+ Here is the caller graph for this function:

◆ help()

ILIAS\DI\Container::help ( )
Returns

Definition at line 224 of file Container.php.

225  {
226  return $this['ilHelp'];
227  }

◆ http()

ILIAS\DI\Container::http ( )
Returns
HTTPServices

Definition at line 184 of file Container.php.

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

185  {
186  return $this['http'];
187  }
+ Here is the caller graph for this function:

◆ iliasIni()

ILIAS\DI\Container::iliasIni ( )
Returns

Definition at line 200 of file Container.php.

201  {
202  return $this['ilIliasIniFile'];
203  }

◆ isDependencyAvailable()

ILIAS\DI\Container::isDependencyAvailable (   $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")

Parameters
$name
Returns
bool

Definition at line 355 of file Container.php.

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

356  {
357  try {
358  $this->$name();
359  } catch (\InvalidArgumentException $e) {
360  return false;
361  }
362  return true;
363  }
if($format !==null) $name
Definition: metadata.php:230

◆ language()

ILIAS\DI\Container::language ( )

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )
Returns

Definition at line 250 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().

251  {
252  return new \ilLearningHistoryService(
253  $this->user(),
254  $this->language(),
255  $this->ui(),
256  $this->access(),
257  $this->repositoryTree()
258  );
259  }
user()
Get the current user.
Definition: Container.php:55
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:75
language()
Get interface to the i18n service.
Definition: Container.php:85
access()
Get interface for access checks.
Definition: Container.php:65
ui()
Get the interface to get services from UI framework.
Definition: Container.php:125
+ Here is the call graph for this function:

◆ logger()

ILIAS\DI\Container::logger ( )

Get interface to get interfaces to different loggers.

Returns
LoggingServices

Definition at line 95 of file Container.php.

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

96  {
97  return new LoggingServices($this);
98  }
+ Here is the caller graph for this function:

◆ news()

ILIAS\DI\Container::news ( )
Returns

Definition at line 264 of file Container.php.

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

265  {
266  return new \ilNewsService($this->language(), $this->settings(), $this->user());
267  }
user()
Get the current user.
Definition: Container.php:55
language()
Get interface to the i18n service.
Definition: Container.php:85
settings()
Get the interface to the settings.
Definition: Container.php:135
+ Here is the call graph for this function:

◆ object()

ILIAS\DI\Container::object ( )
Returns

Definition at line 272 of file Container.php.

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

273  {
274  return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
275  }
language()
Get interface to the i18n service.
Definition: Container.php:85
upload()
Gets the file upload interface.
Definition: Container.php:157
filesystem()
Get the Filesystem service interface.
Definition: Container.php:146
settings()
Get the interface to the settings.
Definition: Container.php:135
+ Here is the call graph for this function:

◆ question()

ILIAS\DI\Container::question ( )
Returns

Definition at line 232 of file Container.php.

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

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Returns
RBACServices

Definition at line 35 of file Container.php.

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

36  {
37  return new RBACServices($this);
38  }
+ Here is the caller graph for this function:

◆ refinery()

ILIAS\DI\Container::refinery ( )
Returns
Factory

Definition at line 297 of file Container.php.

298  {
299  return $this['refinery'];
300  }

◆ repositoryTree()

ILIAS\DI\Container::repositoryTree ( )

Get interface to the repository tree.

Returns

Definition at line 75 of file Container.php.

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

76  {
77  return $this["tree"];
78  }
+ Here is the caller graph for this function:

◆ resourceStorage()

ILIAS\DI\Container::resourceStorage ( )

Definition at line 329 of file Container.php.

330  {
331  return $this['resource_storage'];
332  }

◆ settings()

ILIAS\DI\Container::settings ( )

Get the interface to the settings.

Returns

Definition at line 135 of file Container.php.

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

136  {
137  return $this["ilSetting"];
138  }
+ Here is the caller graph for this function:

◆ skills()

ILIAS\DI\Container::skills ( )
Returns
SkillService

Definition at line 324 of file Container.php.

325  {
326  return new SkillService();
327  }

◆ systemStyle()

ILIAS\DI\Container::systemStyle ( )
Returns

Definition at line 216 of file Container.php.

217  {
218  return $this['styleDefinition'];
219  }

◆ tabs()

ILIAS\DI\Container::tabs ( )

Get interface to the tabs.

Returns

Definition at line 115 of file Container.php.

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

116  {
117  return $this["ilTabs"];
118  }
+ Here is the caller graph for this function:

◆ task()

ILIAS\DI\Container::task ( )
Returns

Definition at line 288 of file Container.php.

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

289  {
290  return new \ilTaskService($this->user(), $this->language(), $this->ui(), $this->access());
291  }
user()
Get the current user.
Definition: Container.php:55
language()
Get interface to the i18n service.
Definition: Container.php:85
access()
Get interface for access checks.
Definition: Container.php:65
ui()
Get the interface to get services from UI framework.
Definition: Container.php:125
+ Here is the call graph for this function:

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Returns

Definition at line 105 of file Container.php.

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

106  {
107  return $this["ilToolbar"];
108  }
+ Here is the caller graph for this function:

◆ ui()

ILIAS\DI\Container::ui ( )

Get the interface to get services from UI framework.

Returns
UIServices

Definition at line 125 of file Container.php.

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

126  {
127  return new UIServices($this);
128  }
+ Here is the caller graph for this function:

◆ uiService()

ILIAS\DI\Container::uiService ( )
Returns

Definition at line 306 of file Container.php.

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

307  {
308  return new \ilUIService($this->http()->request(), $this->ui());
309  }
ui()
Get the interface to get services from UI framework.
Definition: Container.php:125
+ Here is the call graph for this function:

◆ upload()

ILIAS\DI\Container::upload ( )

Gets the file upload interface.

Returns
FileUpload

Definition at line 157 of file Container.php.

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

158  {
159  return $this['upload'];
160  }
+ Here is the caller graph for this function:

◆ user()

ILIAS\DI\Container::user ( )

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