ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPluginInfo Class Reference

Simple value class for information about a plugin. More...

+ Collaboration diagram for ilPluginInfo:

Public Member Functions

 __construct (Version $actual_ilias_version, ilPluginSlotInfo $pluginslot, string $id, string $name, bool $activated, ?Version $current_version, ?int $current_db_version, Version $available_version, Version $minimum_ilias_version, Version $maximum_ilias_version, string $responsible, string $responsible_mail, bool $supports_learning_progress, bool $supports_export, bool $supports_cli_setup)
 
 getPluginSlot ()
 
 getComponent ()
 
 getId ()
 
 getName ()
 
 getPath ()
 
 getClassName ()
 
 getConfigGUIClassName ()
 
 isActivated ()
 "activated" tells if the administrator of the installation wants the plugin to be effective. More...
 
 getCurrentVersion ()
 
 getCurrentDBVersion ()
 
 getAvailableVersion ()
 
 getMinimumILIASVersion ()
 
 getMaximumILIASVersion ()
 
 getResponsible ()
 
 getResponsibleMail ()
 
 supportsLearningProgress ()
 
 supportsExport ()
 
 supportsCLISetup ()
 
 isInstalled ()
 "Installed" tells if the plugin has some installed version. More...
 
 isUpdateRequired ()
 "Update required" tells if the plugin needs an update. More...
 
 isVersionToOld ()
 "Version to old" tells if the plugin code has a version that is below the version that was updated last. More...
 
 isCompliantToILIAS ()
 "ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version. More...
 
 isActivationPossible ()
 Can this plugin be activated right now. More...
 
 isActive ()
 Is this plugin active right now? More...
 
 getReasonForInactivity ()
 Which is the reason for the inactivity? More...
 

Protected Attributes

Version $actual_ilias_version
 
ilPluginSlotInfo $pluginslot
 
string $id
 
string $name
 
bool $activated
 
Version $current_version
 
int $current_db_version
 
Version $available_version
 
Version $minimum_ilias_version
 
Version $maximum_ilias_version
 
string $responsible
 
string $responsible_mail
 
bool $supports_learning_progress
 
bool $supports_export
 
bool $supports_cli_setup
 

Detailed Description

Simple value class for information about a plugin.

Definition at line 26 of file class.ilPluginInfo.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginInfo::__construct ( Version  $actual_ilias_version,
ilPluginSlotInfo  $pluginslot,
string  $id,
string  $name,
bool  $activated,
?Version  $current_version,
?int  $current_db_version,
Version  $available_version,
Version  $minimum_ilias_version,
Version  $maximum_ilias_version,
string  $responsible,
string  $responsible_mail,
bool  $supports_learning_progress,
bool  $supports_export,
bool  $supports_cli_setup 
)

Definition at line 44 of file class.ilPluginInfo.php.

References $activated, $actual_ilias_version, $available_version, $current_db_version, $current_version, $id, $maximum_ilias_version, $minimum_ilias_version, $name, $pluginslot, $responsible, $responsible_mail, $supports_cli_setup, $supports_export, and $supports_learning_progress.

60  {
61  if ($current_version === null && $current_db_version !== null) {
62  throw new \InvalidArgumentException(
63  "If there is no current version for the plugin, we also should not " .
64  "have a db-version."
65  );
66  }
67  $this->actual_ilias_version = $actual_ilias_version;
68  $this->pluginslot = $pluginslot;
69  $this->id = $id;
70  $this->name = $name;
71  $this->activated = $activated;
72  $this->current_version = $current_version;
73  $this->current_db_version = $current_db_version;
74  $this->available_version = $available_version;
75  $this->minimum_ilias_version = $minimum_ilias_version;
76  $this->maximum_ilias_version = $maximum_ilias_version;
77  $this->responsible = $responsible;
78  $this->responsible_mail = $responsible_mail;
79  $this->supports_learning_progress = $supports_learning_progress;
80  $this->supports_export = $supports_export;
81  $this->supports_cli_setup = $supports_cli_setup;
82  }
Version $minimum_ilias_version
bool $supports_learning_progress
ilPluginSlotInfo $pluginslot
Version $current_version
Version $available_version
Version $maximum_ilias_version
Version $actual_ilias_version

Member Function Documentation

◆ getAvailableVersion()

ilPluginInfo::getAvailableVersion ( )

Definition at line 138 of file class.ilPluginInfo.php.

References $available_version.

Referenced by ilPluginsOverviewTable\getContent().

138  : Version
139  {
141  }
Version $available_version
A version number that consists of three numbers (major, minor, patch).
Definition: Version.php:26
+ Here is the caller graph for this function:

◆ getClassName()

ilPluginInfo::getClassName ( )

Definition at line 109 of file class.ilPluginInfo.php.

References getName().

109  : string
110  {
111  return "il" . $this->getName() . "Plugin";
112  }
+ Here is the call graph for this function:

◆ getComponent()

ilPluginInfo::getComponent ( )

Definition at line 89 of file class.ilPluginInfo.php.

Referenced by ilPluginsOverviewTable\filterData(), and ilPluginsOverviewTable\setParameter().

90  {
91  return $this->pluginslot->getComponent();
92  }
Simple value class for basic information about a component.
+ Here is the caller graph for this function:

◆ getConfigGUIClassName()

ilPluginInfo::getConfigGUIClassName ( )

Definition at line 114 of file class.ilPluginInfo.php.

References getName().

Referenced by ilPluginsOverviewTable\getActions().

114  : string
115  {
116  return "il" . $this->getName() . "ConfigGUI";
117  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentDBVersion()

ilPluginInfo::getCurrentDBVersion ( )

Definition at line 133 of file class.ilPluginInfo.php.

References $current_db_version.

Referenced by ilPluginDBUpdate\__construct(), and ilPluginsOverviewTable\getContent().

133  : ?int
134  {
136  }
+ Here is the caller graph for this function:

◆ getCurrentVersion()

ilPluginInfo::getCurrentVersion ( )

Definition at line 128 of file class.ilPluginInfo.php.

References $current_version.

Referenced by ilPluginsOverviewTable\getContent().

128  : ?Version
129  {
130  return $this->current_version;
131  }
Version $current_version
A version number that consists of three numbers (major, minor, patch).
Definition: Version.php:26
+ Here is the caller graph for this function:

◆ getId()

ilPluginInfo::getId ( )

Definition at line 94 of file class.ilPluginInfo.php.

References $id.

Referenced by ilPluginsOverviewTable\filterData(), ilPluginsOverviewTable\getContent(), and ilPluginsOverviewTable\setParameter().

94  : string
95  {
96  return $this->id;
97  }
+ Here is the caller graph for this function:

◆ getMaximumILIASVersion()

ilPluginInfo::getMaximumILIASVersion ( )

Definition at line 148 of file class.ilPluginInfo.php.

References $maximum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

148  : Version
149  {
151  }
Version $maximum_ilias_version
A version number that consists of three numbers (major, minor, patch).
Definition: Version.php:26
+ Here is the caller graph for this function:

◆ getMinimumILIASVersion()

ilPluginInfo::getMinimumILIASVersion ( )

Definition at line 143 of file class.ilPluginInfo.php.

References $minimum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

143  : Version
144  {
146  }
Version $minimum_ilias_version
A version number that consists of three numbers (major, minor, patch).
Definition: Version.php:26
+ Here is the caller graph for this function:

◆ getName()

ilPluginInfo::getName ( )

Definition at line 99 of file class.ilPluginInfo.php.

References $name.

Referenced by ilPluginsOverviewTable\filterData(), getClassName(), getConfigGUIClassName(), getPath(), ilPluginsOverviewTable\getTable(), and ilPluginsOverviewTable\setParameter().

99  : string
100  {
101  return $this->name;
102  }
+ Here is the caller graph for this function:

◆ getPath()

ilPluginInfo::getPath ( )

Definition at line 104 of file class.ilPluginInfo.php.

References getName().

104  : string
105  {
106  return $this->pluginslot->getPath() . "/" . $this->getName();
107  }
+ Here is the call graph for this function:

◆ getPluginSlot()

ilPluginInfo::getPluginSlot ( )

Definition at line 84 of file class.ilPluginInfo.php.

References $pluginslot.

Referenced by ilPluginsOverviewTable\filterData(), ilPluginsOverviewTable\getContent(), ilPluginsOverviewTable\getTable(), and ilPluginsOverviewTable\setParameter().

85  {
86  return $this->pluginslot;
87  }
ilPluginSlotInfo $pluginslot
Simple value class for basic information about a pluginslot.
+ Here is the caller graph for this function:

◆ getReasonForInactivity()

ilPluginInfo::getReasonForInactivity ( )

Which is the reason for the inactivity?

Exceptions

Definition at line 240 of file class.ilPluginInfo.php.

References isActivated(), isActive(), isCompliantToILIAS(), isInstalled(), isUpdateRequired(), and isVersionToOld().

Referenced by ilPluginInfoTest\testGetReasonForInactivity(), and ilPluginInfoTest\testGetReasonForInactivityThrowsOnActivePlugin().

240  : string
241  {
242  if ($this->isActive()) {
243  throw new \LogicException(
244  "Plugin is active, so no reason for inactivity."
245  );
246  }
247 
248  if (!$this->isCompliantToILIAS()) {
249  return "cmps_needs_matching_ilias_version";
250  }
251 
252  if (!$this->isInstalled()) {
253  return "cmps_must_installed";
254  }
255 
256  if ($this->isVersionToOld()) {
257  return "cmps_needs_upgrade";
258  }
259 
260  if ($this->isUpdateRequired()) {
261  return "cmps_needs_update";
262  }
263 
264  if (!$this->isActivated()) {
265  return "cmps_not_activated";
266  }
267 
268  throw new \LogicException(
269  "Unknown reason for inactivity of the plugin."
270  );
271  }
isActive()
Is this plugin active right now?
isInstalled()
"Installed" tells if the plugin has some installed version.
isCompliantToILIAS()
"ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version...
isUpdateRequired()
"Update required" tells if the plugin needs an update.
isVersionToOld()
"Version to old" tells if the plugin code has a version that is below the version that was updated la...
isActivated()
"activated" tells if the administrator of the installation wants the plugin to be effective...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResponsible()

ilPluginInfo::getResponsible ( )

Definition at line 153 of file class.ilPluginInfo.php.

References $responsible.

Referenced by ilPluginsOverviewTable\getContent().

153  : string
154  {
155  return $this->responsible;
156  }
+ Here is the caller graph for this function:

◆ getResponsibleMail()

ilPluginInfo::getResponsibleMail ( )

Definition at line 158 of file class.ilPluginInfo.php.

References $responsible_mail.

Referenced by ilPluginsOverviewTable\getContent().

158  : string
159  {
161  }
+ Here is the caller graph for this function:

◆ isActivated()

ilPluginInfo::isActivated ( )

"activated" tells if the administrator of the installation wants the plugin to be effective.

Compare to "active".

Definition at line 123 of file class.ilPluginInfo.php.

References $activated.

Referenced by getReasonForInactivity(), and isActive().

123  : bool
124  {
125  return $this->activated;
126  }
+ Here is the caller graph for this function:

◆ isActivationPossible()

ilPluginInfo::isActivationPossible ( )

Can this plugin be activated right now.

Definition at line 217 of file class.ilPluginInfo.php.

References isCompliantToILIAS(), isInstalled(), isUpdateRequired(), and isVersionToOld().

Referenced by ilPluginsOverviewTable\getActions(), isActive(), and ilPluginInfoTest\testIsActivationPossible().

217  : bool
218  {
219  return $this->isCompliantToILIAS()
220  && $this->isInstalled()
221  && !$this->isVersionToOld()
222  && !$this->isUpdateRequired();
223  }
isInstalled()
"Installed" tells if the plugin has some installed version.
isCompliantToILIAS()
"ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version...
isUpdateRequired()
"Update required" tells if the plugin needs an update.
isVersionToOld()
"Version to old" tells if the plugin code has a version that is below the version that was updated la...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

ilPluginInfo::isActive ( )

Is this plugin active right now?

Definition at line 228 of file class.ilPluginInfo.php.

References isActivated(), and isActivationPossible().

Referenced by ilPluginsOverviewTable\filterData(), ilPluginsOverviewTable\getActions(), ilPluginsOverviewTable\getContent(), ilPluginsOverviewTable\getImportantFields(), getReasonForInactivity(), and ilPluginInfoTest\testIsActive().

228  : bool
229  {
230  return $this->isActivationPossible()
231  && $this->isActivated();
232  }
isActivationPossible()
Can this plugin be activated right now.
isActivated()
"activated" tells if the administrator of the installation wants the plugin to be effective...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCompliantToILIAS()

ilPluginInfo::isCompliantToILIAS ( )

"ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version.

Definition at line 207 of file class.ilPluginInfo.php.

Referenced by getReasonForInactivity(), isActivationPossible(), and ilPluginInfoTest\testIsCompliantToILIAS().

207  : bool
208  {
209  return
210  $this->actual_ilias_version->isGreaterThanOrEquals($this->minimum_ilias_version)
211  && $this->actual_ilias_version->isSmallerThanOrEquals($this->maximum_ilias_version);
212  }
+ Here is the caller graph for this function:

◆ isInstalled()

ilPluginInfo::isInstalled ( )

"Installed" tells if the plugin has some installed version.

Definition at line 181 of file class.ilPluginInfo.php.

Referenced by ilPluginsOverviewTable\getActions(), ilPluginsOverviewTable\getContent(), ilPluginsOverviewTable\getImportantFields(), getReasonForInactivity(), isActivationPossible(), and isUpdateRequired().

181  : bool
182  {
183  return $this->current_version !== null;
184  }
+ Here is the caller graph for this function:

◆ isUpdateRequired()

ilPluginInfo::isUpdateRequired ( )

"Update required" tells if the plugin needs an update.

Definition at line 189 of file class.ilPluginInfo.php.

References isInstalled().

Referenced by ilPluginsOverviewTable\getActions(), ilPluginsOverviewTable\getContent(), ilPluginsOverviewTable\getImportantFields(), getReasonForInactivity(), and isActivationPossible().

189  : bool
190  {
191  return $this->isInstalled() && !$this->current_version->equals($this->available_version);
192  }
isInstalled()
"Installed" tells if the plugin has some installed version.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVersionToOld()

ilPluginInfo::isVersionToOld ( )

"Version to old" tells if the plugin code has a version that is below the version that was updated last.

Definition at line 198 of file class.ilPluginInfo.php.

Referenced by getReasonForInactivity(), and isActivationPossible().

198  : bool
199  {
200  return $this->current_version->isGreaterThan($this->available_version);
201  }
+ Here is the caller graph for this function:

◆ supportsCLISetup()

ilPluginInfo::supportsCLISetup ( )

Definition at line 173 of file class.ilPluginInfo.php.

References $supports_cli_setup.

Referenced by ilPluginsOverviewTable\getContent().

173  : bool
174  {
176  }
+ Here is the caller graph for this function:

◆ supportsExport()

ilPluginInfo::supportsExport ( )

Definition at line 168 of file class.ilPluginInfo.php.

References $supports_export.

Referenced by ilPluginsOverviewTable\getContent().

168  : bool
169  {
170  return $this->supports_export;
171  }
+ Here is the caller graph for this function:

◆ supportsLearningProgress()

ilPluginInfo::supportsLearningProgress ( )

Definition at line 163 of file class.ilPluginInfo.php.

References $supports_learning_progress.

Referenced by ilPluginsOverviewTable\getContent().

163  : bool
164  {
166  }
bool $supports_learning_progress
+ Here is the caller graph for this function:

Field Documentation

◆ $activated

bool ilPluginInfo::$activated
protected

Definition at line 32 of file class.ilPluginInfo.php.

Referenced by __construct(), and isActivated().

◆ $actual_ilias_version

Version ilPluginInfo::$actual_ilias_version
protected

Definition at line 28 of file class.ilPluginInfo.php.

Referenced by __construct().

◆ $available_version

Version ilPluginInfo::$available_version
protected

Definition at line 35 of file class.ilPluginInfo.php.

Referenced by __construct(), and getAvailableVersion().

◆ $current_db_version

int ilPluginInfo::$current_db_version
protected

Definition at line 34 of file class.ilPluginInfo.php.

Referenced by __construct(), and getCurrentDBVersion().

◆ $current_version

Version ilPluginInfo::$current_version
protected

Definition at line 33 of file class.ilPluginInfo.php.

Referenced by __construct(), and getCurrentVersion().

◆ $id

string ilPluginInfo::$id
protected

Definition at line 30 of file class.ilPluginInfo.php.

Referenced by __construct(), and getId().

◆ $maximum_ilias_version

Version ilPluginInfo::$maximum_ilias_version
protected

Definition at line 37 of file class.ilPluginInfo.php.

Referenced by __construct(), and getMaximumILIASVersion().

◆ $minimum_ilias_version

Version ilPluginInfo::$minimum_ilias_version
protected

Definition at line 36 of file class.ilPluginInfo.php.

Referenced by __construct(), and getMinimumILIASVersion().

◆ $name

string ilPluginInfo::$name
protected

Definition at line 31 of file class.ilPluginInfo.php.

Referenced by __construct(), and getName().

◆ $pluginslot

ilPluginSlotInfo ilPluginInfo::$pluginslot
protected

Definition at line 29 of file class.ilPluginInfo.php.

Referenced by __construct(), and getPluginSlot().

◆ $responsible

string ilPluginInfo::$responsible
protected

Definition at line 38 of file class.ilPluginInfo.php.

Referenced by __construct(), and getResponsible().

◆ $responsible_mail

string ilPluginInfo::$responsible_mail
protected

Definition at line 39 of file class.ilPluginInfo.php.

Referenced by __construct(), and getResponsibleMail().

◆ $supports_cli_setup

bool ilPluginInfo::$supports_cli_setup
protected

Definition at line 42 of file class.ilPluginInfo.php.

Referenced by __construct(), and supportsCLISetup().

◆ $supports_export

bool ilPluginInfo::$supports_export
protected

Definition at line 41 of file class.ilPluginInfo.php.

Referenced by __construct(), and supportsExport().

◆ $supports_learning_progress

bool ilPluginInfo::$supports_learning_progress
protected

Definition at line 40 of file class.ilPluginInfo.php.

Referenced by __construct(), and supportsLearningProgress().


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