ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
 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 17 of file Container.php.

Member Function Documentation

◆ access()

ILIAS\DI\Container::access ( )

Get interface for access checks.

Returns

Definition at line 64 of file Container.php.

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

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

◆ backgroundTasks()

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

Definition at line 165 of file Container.php.

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

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

◆ bookingManager()

ILIAS\DI\Container::bookingManager ( )
Returns

Definition at line 314 of file Container.php.

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

◆ clientIni()

ILIAS\DI\Container::clientIni ( )
Returns

Definition at line 207 of file Container.php.

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

◆ conditions()

ILIAS\DI\Container::conditions ( )

Get conditions service.

Returns

Definition at line 241 of file Container.php.

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

◆ ctrl()

ILIAS\DI\Container::ctrl ( )

Get the interface to the control structure.

Returns

Definition at line 44 of file Container.php.

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

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

◆ database()

ILIAS\DI\Container::database ( )

Get interface to the Database.

Returns

Definition at line 24 of file Container.php.

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

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

◆ event()

ILIAS\DI\Container::event ( )
Returns

Definition at line 191 of file Container.php.

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

◆ exercise()

ILIAS\DI\Container::exercise ( )
Returns

Definition at line 279 of file Container.php.

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

◆ filesystem()

ILIAS\DI\Container::filesystem ( )

Get the Filesystem service interface.

Returns
Filesystems

Definition at line 145 of file Container.php.

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

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

◆ globalScreen()

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

Definition at line 174 of file Container.php.

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

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

◆ help()

ILIAS\DI\Container::help ( )
Returns

Definition at line 223 of file Container.php.

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

◆ http()

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

Definition at line 183 of file Container.php.

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

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

◆ iliasIni()

ILIAS\DI\Container::iliasIni ( )
Returns

Definition at line 199 of file Container.php.

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

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

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

341  {
342  try {
343  $this->$name();
344  } catch (\InvalidArgumentException $e) {
345  return false;
346  }
347  return true;
348  }
if($format !==null) $name
Definition: metadata.php:230

◆ language()

ILIAS\DI\Container::language ( )

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )
Returns

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

250  {
251  return new \ilLearningHistoryService(
252  $this->user(),
253  $this->language(),
254  $this->ui(),
255  $this->access(),
256  $this->repositoryTree()
257  );
258  }
user()
Get the current user.
Definition: Container.php:54
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:74
language()
Get interface to the i18n service.
Definition: Container.php:84
access()
Get interface for access checks.
Definition: Container.php:64
ui()
Get the interface to get services from UI framework.
Definition: Container.php:124
+ 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 94 of file Container.php.

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

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

◆ news()

ILIAS\DI\Container::news ( )
Returns

Definition at line 263 of file Container.php.

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

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

◆ object()

ILIAS\DI\Container::object ( )
Returns

Definition at line 271 of file Container.php.

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

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

◆ question()

ILIAS\DI\Container::question ( )
Returns

Definition at line 231 of file Container.php.

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

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Returns
RBACServices

Definition at line 34 of file Container.php.

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

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

◆ refinery()

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

Definition at line 296 of file Container.php.

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

◆ repositoryTree()

ILIAS\DI\Container::repositoryTree ( )

Get interface to the repository tree.

Returns

Definition at line 74 of file Container.php.

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

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

◆ settings()

ILIAS\DI\Container::settings ( )

Get the interface to the settings.

Returns

Definition at line 134 of file Container.php.

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

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

◆ systemStyle()

ILIAS\DI\Container::systemStyle ( )
Returns

Definition at line 215 of file Container.php.

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

◆ tabs()

ILIAS\DI\Container::tabs ( )

Get interface to the tabs.

Returns

Definition at line 114 of file Container.php.

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

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

◆ task()

ILIAS\DI\Container::task ( )
Returns

Definition at line 287 of file Container.php.

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

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

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Returns

Definition at line 104 of file Container.php.

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

105  {
106  return $this["ilToolbar"];
107  }
+ 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 124 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().

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

◆ uiService()

ILIAS\DI\Container::uiService ( )
Returns

Definition at line 305 of file Container.php.

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

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

◆ upload()

ILIAS\DI\Container::upload ( )

Gets the file upload interface.

Returns
FileUpload

Definition at line 156 of file Container.php.

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

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

◆ user()

ILIAS\DI\Container::user ( )

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