ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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, string $type, 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 ()
 
 getType ()
 
 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
 
string $type
 
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 27 of file class.ilPluginInfo.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginInfo::__construct ( Version  $actual_ilias_version,
ilPluginSlotInfo  $pluginslot,
string  $id,
string  $name,
string  $type,
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 46 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, $supports_learning_progress, and $type.

63  {
64  if ($current_version === null && $current_db_version !== null) {
65  throw new \InvalidArgumentException(
66  "If there is no current version for the plugin, we also should not " .
67  "have a db-version."
68  );
69  }
70  $this->actual_ilias_version = $actual_ilias_version;
71  $this->pluginslot = $pluginslot;
72  $this->id = $id;
73  $this->name = $name;
74  $this->type = $type;
75  $this->activated = $activated;
76  $this->current_version = $current_version;
77  $this->current_db_version = $current_db_version;
78  $this->available_version = $available_version;
79  $this->minimum_ilias_version = $minimum_ilias_version;
80  $this->maximum_ilias_version = $maximum_ilias_version;
81  $this->responsible = $responsible;
82  $this->responsible_mail = $responsible_mail;
83  $this->supports_learning_progress = $supports_learning_progress;
84  $this->supports_export = $supports_export;
85  $this->supports_cli_setup = $supports_cli_setup;
86  }
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 153 of file class.ilPluginInfo.php.

References $available_version.

Referenced by ilPluginsOverviewTable\getContent().

153  : Version
154  {
156  }
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 124 of file class.ilPluginInfo.php.

References getName().

124  : string
125  {
126  return "il" . $this->getName() . "Plugin";
127  }
+ Here is the call graph for this function:

◆ getComponent()

ilPluginInfo::getComponent ( )

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

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

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

◆ getConfigGUIClassName()

ilPluginInfo::getConfigGUIClassName ( )

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

References getName().

Referenced by ilPluginsOverviewTable\getActions().

129  : string
130  {
131  return "il" . $this->getName() . "ConfigGUI";
132  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentDBVersion()

ilPluginInfo::getCurrentDBVersion ( )

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

References $current_db_version.

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

148  : ?int
149  {
151  }
+ Here is the caller graph for this function:

◆ getCurrentVersion()

ilPluginInfo::getCurrentVersion ( )

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

References $current_version.

Referenced by ilPluginsOverviewTable\getContent().

143  : ?Version
144  {
145  return $this->current_version;
146  }
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 98 of file class.ilPluginInfo.php.

References $id.

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

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

◆ getMaximumILIASVersion()

ilPluginInfo::getMaximumILIASVersion ( )

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

References $maximum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

163  : Version
164  {
166  }
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 158 of file class.ilPluginInfo.php.

References $minimum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

158  : Version
159  {
161  }
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 103 of file class.ilPluginInfo.php.

References $name.

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

103  : string
104  {
105  return $this->name;
106  }
+ Here is the caller graph for this function:

◆ getPath()

ilPluginInfo::getPath ( )

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

References getComponent(), getName(), getPluginSlot(), getType(), and ilComponentRepository\PLUGIN_BASE_PATH.

113  : string
114  {
115  return implode('/', [
117  $this->getType(),
118  $this->getComponent()->getName(),
119  $this->getPluginSlot()->getName(),
120  $this->getName()
121  ]);
122  }
+ Here is the call graph for this function:

◆ getPluginSlot()

ilPluginInfo::getPluginSlot ( )

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

References $pluginslot.

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

89  {
90  return $this->pluginslot;
91  }
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 255 of file class.ilPluginInfo.php.

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

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

255  : string
256  {
257  if ($this->isActive()) {
258  throw new \LogicException(
259  "Plugin is active, so no reason for inactivity."
260  );
261  }
262 
263  if (!$this->isCompliantToILIAS()) {
264  return "cmps_needs_matching_ilias_version";
265  }
266 
267  if (!$this->isInstalled()) {
268  return "cmps_must_installed";
269  }
270 
271  if ($this->isVersionToOld()) {
272  return "cmps_needs_upgrade";
273  }
274 
275  if ($this->isUpdateRequired()) {
276  return "cmps_needs_update";
277  }
278 
279  if (!$this->isActivated()) {
280  return "cmps_not_activated";
281  }
282 
283  throw new \LogicException(
284  "Unknown reason for inactivity of the plugin."
285  );
286  }
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 168 of file class.ilPluginInfo.php.

References $responsible.

Referenced by ilPluginsOverviewTable\getContent().

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

◆ getResponsibleMail()

ilPluginInfo::getResponsibleMail ( )

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

References $responsible_mail.

Referenced by ilPluginsOverviewTable\getContent().

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

◆ getType()

ilPluginInfo::getType ( )

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

References $type.

Referenced by getPath().

108  : string
109  {
110  return $this->type;
111  }
+ 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 138 of file class.ilPluginInfo.php.

References $activated.

Referenced by getReasonForInactivity(), and isActive().

138  : bool
139  {
140  return $this->activated;
141  }
+ Here is the caller graph for this function:

◆ isActivationPossible()

ilPluginInfo::isActivationPossible ( )

Can this plugin be activated right now.

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

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

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

232  : bool
233  {
234  return $this->isCompliantToILIAS()
235  && $this->isInstalled()
236  && !$this->isVersionToOld()
237  && !$this->isUpdateRequired();
238  }
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 243 of file class.ilPluginInfo.php.

References isActivated(), and isActivationPossible().

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

243  : bool
244  {
245  return $this->isActivationPossible()
246  && $this->isActivated();
247  }
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 222 of file class.ilPluginInfo.php.

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

222  : bool
223  {
224  return
225  $this->actual_ilias_version->isGreaterThanOrEquals($this->minimum_ilias_version)
226  && $this->actual_ilias_version->isSmallerThanOrEquals($this->maximum_ilias_version);
227  }
+ Here is the caller graph for this function:

◆ isInstalled()

ilPluginInfo::isInstalled ( )

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

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

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

196  : bool
197  {
198  return $this->current_version !== null;
199  }
+ Here is the caller graph for this function:

◆ isUpdateRequired()

ilPluginInfo::isUpdateRequired ( )

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

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

References isInstalled().

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

204  : bool
205  {
206  return $this->isInstalled() && !$this->current_version->equals($this->available_version);
207  }
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 213 of file class.ilPluginInfo.php.

Referenced by getReasonForInactivity(), and isActivationPossible().

213  : bool
214  {
215  return $this->current_version->isGreaterThan($this->available_version);
216  }
+ Here is the caller graph for this function:

◆ supportsCLISetup()

ilPluginInfo::supportsCLISetup ( )

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

References $supports_cli_setup.

Referenced by ilPluginsOverviewTable\getContent().

188  : bool
189  {
191  }
+ Here is the caller graph for this function:

◆ supportsExport()

ilPluginInfo::supportsExport ( )

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

References $supports_export.

Referenced by ilPluginsOverviewTable\getContent().

183  : bool
184  {
185  return $this->supports_export;
186  }
+ Here is the caller graph for this function:

◆ supportsLearningProgress()

ilPluginInfo::supportsLearningProgress ( )

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

References $supports_learning_progress.

Referenced by ilPluginsOverviewTable\getContent().

178  : bool
179  {
181  }
bool $supports_learning_progress
+ Here is the caller graph for this function:

Field Documentation

◆ $activated

bool ilPluginInfo::$activated
protected

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

Referenced by __construct(), and isActivated().

◆ $actual_ilias_version

Version ilPluginInfo::$actual_ilias_version
protected

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

Referenced by __construct().

◆ $available_version

Version ilPluginInfo::$available_version
protected

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

Referenced by __construct(), and getAvailableVersion().

◆ $current_db_version

int ilPluginInfo::$current_db_version
protected

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

Referenced by __construct(), and getCurrentDBVersion().

◆ $current_version

Version ilPluginInfo::$current_version
protected

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

Referenced by __construct(), and getCurrentVersion().

◆ $id

string ilPluginInfo::$id
protected

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

Referenced by __construct(), and getId().

◆ $maximum_ilias_version

Version ilPluginInfo::$maximum_ilias_version
protected

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

Referenced by __construct(), and getMaximumILIASVersion().

◆ $minimum_ilias_version

Version ilPluginInfo::$minimum_ilias_version
protected

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

Referenced by __construct(), and getMinimumILIASVersion().

◆ $name

string ilPluginInfo::$name
protected

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

Referenced by __construct(), and getName().

◆ $pluginslot

ilPluginSlotInfo ilPluginInfo::$pluginslot
protected

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

Referenced by __construct(), and getPluginSlot().

◆ $responsible

string ilPluginInfo::$responsible
protected

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

Referenced by __construct(), and getResponsible().

◆ $responsible_mail

string ilPluginInfo::$responsible_mail
protected

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

Referenced by __construct(), and getResponsibleMail().

◆ $supports_cli_setup

bool ilPluginInfo::$supports_cli_setup
protected

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

Referenced by __construct(), and supportsCLISetup().

◆ $supports_export

bool ilPluginInfo::$supports_export
protected

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

Referenced by __construct(), and supportsExport().

◆ $supports_learning_progress

bool ilPluginInfo::$supports_learning_progress
protected

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

Referenced by __construct(), and supportsLearningProgress().

◆ $type

string ilPluginInfo::$type
protected

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

Referenced by __construct(), and getType().


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