ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 26 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 45 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, $type, and null.

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

Member Function Documentation

◆ getAvailableVersion()

ilPluginInfo::getAvailableVersion ( )

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

References $available_version.

Referenced by ilPluginsOverviewTable\getContent().

152  : Version
153  {
155  }
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 123 of file class.ilPluginInfo.php.

References getName().

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

◆ getComponent()

ilPluginInfo::getComponent ( )

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

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

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

◆ getConfigGUIClassName()

ilPluginInfo::getConfigGUIClassName ( )

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

References getName().

Referenced by ilPluginsOverviewTable\getActions().

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

◆ getCurrentDBVersion()

ilPluginInfo::getCurrentDBVersion ( )

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

References $current_db_version.

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

147  : ?int
148  {
150  }
+ Here is the caller graph for this function:

◆ getCurrentVersion()

ilPluginInfo::getCurrentVersion ( )

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

References $current_version.

Referenced by ilPluginsOverviewTable\getContent().

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

References $id.

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

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

◆ getMaximumILIASVersion()

ilPluginInfo::getMaximumILIASVersion ( )

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

References $maximum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

162  : Version
163  {
165  }
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 157 of file class.ilPluginInfo.php.

References $minimum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

157  : Version
158  {
160  }
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 102 of file class.ilPluginInfo.php.

References $name.

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

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

◆ getPath()

ilPluginInfo::getPath ( )

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

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

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

◆ getPluginSlot()

ilPluginInfo::getPluginSlot ( )

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

References $pluginslot.

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

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

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

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

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

References $responsible.

Referenced by ilPluginsOverviewTable\getContent().

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

◆ getResponsibleMail()

ilPluginInfo::getResponsibleMail ( )

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

References $responsible_mail.

Referenced by ilPluginsOverviewTable\getContent().

172  : string
173  {
175  }
+ Here is the caller graph for this function:

◆ getType()

ilPluginInfo::getType ( )

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

References $type.

Referenced by getPath().

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

References $activated.

Referenced by getReasonForInactivity(), and isActive().

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

◆ isActivationPossible()

ilPluginInfo::isActivationPossible ( )

Can this plugin be activated right now.

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

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

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

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

References isActivated(), and isActivationPossible().

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

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

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

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

◆ isInstalled()

ilPluginInfo::isInstalled ( )

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

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

References null.

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

195  : bool
196  {
197  return $this->current_version !== null;
198  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ isUpdateRequired()

ilPluginInfo::isUpdateRequired ( )

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

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

References isInstalled().

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

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

Referenced by getReasonForInactivity(), and isActivationPossible().

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

◆ supportsCLISetup()

ilPluginInfo::supportsCLISetup ( )

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

References $supports_cli_setup.

Referenced by ilPluginsOverviewTable\getContent().

187  : bool
188  {
190  }
+ Here is the caller graph for this function:

◆ supportsExport()

ilPluginInfo::supportsExport ( )

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

References $supports_export.

Referenced by ilPluginsOverviewTable\getContent().

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

◆ supportsLearningProgress()

ilPluginInfo::supportsLearningProgress ( )

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

References $supports_learning_progress.

Referenced by ilPluginsOverviewTable\getContent().

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

Field Documentation

◆ $activated

bool ilPluginInfo::$activated
protected

Definition at line 33 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 36 of file class.ilPluginInfo.php.

Referenced by __construct(), and getAvailableVersion().

◆ $current_db_version

int ilPluginInfo::$current_db_version
protected

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

Referenced by __construct(), and getCurrentDBVersion().

◆ $current_version

Version ilPluginInfo::$current_version
protected

Definition at line 34 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 38 of file class.ilPluginInfo.php.

Referenced by __construct(), and getMaximumILIASVersion().

◆ $minimum_ilias_version

Version ilPluginInfo::$minimum_ilias_version
protected

Definition at line 37 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 39 of file class.ilPluginInfo.php.

Referenced by __construct(), and getResponsible().

◆ $responsible_mail

string ilPluginInfo::$responsible_mail
protected

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

Referenced by __construct(), and getResponsibleMail().

◆ $supports_cli_setup

bool ilPluginInfo::$supports_cli_setup
protected

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

Referenced by __construct(), and supportsCLISetup().

◆ $supports_export

bool ilPluginInfo::$supports_export
protected

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

Referenced by __construct(), and supportsExport().

◆ $supports_learning_progress

bool ilPluginInfo::$supports_learning_progress
protected

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

Referenced by __construct(), and supportsLearningProgress().

◆ $type

string ilPluginInfo::$type
protected

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

Referenced by __construct(), and getType().


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