ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 conditions ()
 Get conditions service. More...
 
 learningHistory ()
 
 news ()
 
 object ()
 
 isDependencyAvailable ($name)
 Note: Only use isDependencyAvailable if strictly required. More...
 
- Public Member Functions inherited from Pimple\Container
 __construct (array $values=array())
 Instantiate the container. More...
 
 offsetSet ($id, $value)
 Sets a parameter or an object. More...
 
 offsetGet ($id)
 Gets a parameter or an object. More...
 
 offsetExists ($id)
 Checks if a parameter or an object is set. More...
 
 offsetUnset ($id)
 Unsets a parameter or an object. More...
 
 factory ($callable)
 Marks a callable as being a factory service. More...
 
 protect ($callable)
 Protects a callable from being interpreted as a service. More...
 
 raw ($id)
 Gets a parameter or the closure defining an object. More...
 
 extend ($id, $callable)
 Extends an object definition. More...
 
 keys ()
 Returns all defined value names. More...
 
 register (ServiceProviderInterface $provider, array $values=array())
 Registers a service provider. 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 16 of file Container.php.

Member Function Documentation

◆ access()

ILIAS\DI\Container::access ( )

Get interface for access checks.

Returns

Definition at line 63 of file Container.php.

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

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

◆ backgroundTasks()

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

Definition at line 164 of file Container.php.

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

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

◆ clientIni()

ILIAS\DI\Container::clientIni ( )
Returns

Definition at line 206 of file Container.php.

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

◆ conditions()

ILIAS\DI\Container::conditions ( )

Get conditions service.

Returns

Definition at line 232 of file Container.php.

233  {
234  return \ilConditionService::getInstance(new \ilConditionObjectAdapter());
235  }
Wraps ilObject dependencies.

◆ ctrl()

ILIAS\DI\Container::ctrl ( )

Get the interface to the control structure.

Returns

Definition at line 43 of file Container.php.

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

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

◆ database()

ILIAS\DI\Container::database ( )

Get interface to the Database.

Returns

Definition at line 23 of file Container.php.

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

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

◆ event()

ILIAS\DI\Container::event ( )
Returns

Definition at line 190 of file Container.php.

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

◆ filesystem()

ILIAS\DI\Container::filesystem ( )

Get the Filesystem service interface.

Returns
Filesystems

Definition at line 144 of file Container.php.

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

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

◆ globalScreen()

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

Definition at line 173 of file Container.php.

174  {
175  return $this['global_screen'];
176  }

◆ help()

ILIAS\DI\Container::help ( )
Returns

Definition at line 222 of file Container.php.

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

◆ http()

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

Definition at line 182 of file Container.php.

183  {
184  return $this['http'];
185  }

◆ iliasIni()

ILIAS\DI\Container::iliasIni ( )
Returns

Definition at line 198 of file Container.php.

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

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

References $name.

289  {
290  try {
291  $this->$name();
292  } catch (\InvalidArgumentException $e) {
293  return false;
294  }
295  return true;
296  }

◆ language()

ILIAS\DI\Container::language ( )

Get interface to the i18n service.

Returns

Definition at line 83 of file Container.php.

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

84  {
85  return $this["lng"];
86  }
+ Here is the caller graph for this function:

◆ learningHistory()

ILIAS\DI\Container::learningHistory ( )
Returns

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

241  {
242  return new \ilLearningHistoryService(
243  $this->user(),
244  $this->language(),
245  $this->ui(),
246  $this->access(),
247  $this->repositoryTree()
248  );
249  }
user()
Get the current user.
Definition: Container.php:53
repositoryTree()
Get interface to the repository tree.
Definition: Container.php:73
language()
Get interface to the i18n service.
Definition: Container.php:83
access()
Get interface for access checks.
Definition: Container.php:63
ui()
Get the interface to get services from UI framework.
Definition: Container.php:123
+ 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 93 of file Container.php.

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

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

◆ news()

ILIAS\DI\Container::news ( )
Returns

Definition at line 254 of file Container.php.

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

255  {
256  return new \ilNewsService($this->language(), $this->settings(), $this->user());
257  }
user()
Get the current user.
Definition: Container.php:53
language()
Get interface to the i18n service.
Definition: Container.php:83
settings()
Get the interface to the settings.
Definition: Container.php:133
+ Here is the call graph for this function:

◆ object()

ILIAS\DI\Container::object ( )
Returns

Definition at line 262 of file Container.php.

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

263  {
264  return new \ilObjectService($this->language(), $this->settings(), $this->filesystem(), $this->upload());
265  }
language()
Get interface to the i18n service.
Definition: Container.php:83
upload()
Gets the file upload interface.
Definition: Container.php:155
filesystem()
Get the Filesystem service interface.
Definition: Container.php:144
settings()
Get the interface to the settings.
Definition: Container.php:133
+ Here is the call graph for this function:

◆ rbac()

ILIAS\DI\Container::rbac ( )

Get interface to get interfaces to all things rbac.

Returns
RBACServices

Definition at line 33 of file Container.php.

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

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

◆ repositoryTree()

ILIAS\DI\Container::repositoryTree ( )

Get interface to the repository tree.

Returns

Definition at line 73 of file Container.php.

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

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

◆ settings()

ILIAS\DI\Container::settings ( )

Get the interface to the settings.

Returns

Definition at line 133 of file Container.php.

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

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

◆ systemStyle()

ILIAS\DI\Container::systemStyle ( )
Returns

Definition at line 214 of file Container.php.

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

◆ tabs()

ILIAS\DI\Container::tabs ( )

Get interface to the tabs.

Returns

Definition at line 113 of file Container.php.

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

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

◆ toolbar()

ILIAS\DI\Container::toolbar ( )

Get interface to the toolbar.

Returns

Definition at line 103 of file Container.php.

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

104  {
105  return $this["ilToolbar"];
106  }
+ 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 123 of file Container.php.

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

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

◆ upload()

ILIAS\DI\Container::upload ( )

Gets the file upload interface.

Returns
FileUpload

Definition at line 155 of file Container.php.

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

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

◆ user()

ILIAS\DI\Container::user ( )

Get the current user.

Returns

Definition at line 53 of file Container.php.

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

54  {
55  return $this["ilUser"];
56  }
+ Here is the caller graph for this function:

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