ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

62 {
63 if ($current_version === null && $current_db_version !== null) {
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 $maximum_ilias_version
Version $available_version
bool $supports_learning_progress
ilPluginSlotInfo $pluginslot
Version $current_version
Version $minimum_ilias_version
Version $actual_ilias_version

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.

Member Function Documentation

◆ getAvailableVersion()

ilPluginInfo::getAvailableVersion ( )

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

152 : Version
153 {
155 }
A version number that consists of three numbers (major, minor, patch).
Definition: Version.php:27

References $available_version.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getClassName()

ilPluginInfo::getClassName ( )

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

123 : string
124 {
125 return "il" . $this->getName() . "Plugin";
126 }

References getName().

+ Here is the call graph for this function:

◆ getComponent()

ilPluginInfo::getComponent ( )

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

93 {
94 return $this->pluginslot->getComponent();
95 }
Simple value class for basic information about a component.

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

+ Here is the caller graph for this function:

◆ getConfigGUIClassName()

ilPluginInfo::getConfigGUIClassName ( )

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

128 : string
129 {
130 return "il" . $this->getName() . "ConfigGUI";
131 }

References getName().

Referenced by ilPluginsOverviewTable\getActions().

+ 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.

147 : ?int
148 {
150 }

References $current_db_version.

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

+ Here is the caller graph for this function:

◆ getCurrentVersion()

ilPluginInfo::getCurrentVersion ( )

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

142 : ?Version
143 {
145 }

References $current_version.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getId()

ilPluginInfo::getId ( )

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

97 : string
98 {
99 return $this->id;
100 }

References $id.

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

+ Here is the caller graph for this function:

◆ getMaximumILIASVersion()

ilPluginInfo::getMaximumILIASVersion ( )

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

162 : Version
163 {
165 }

References $maximum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getMinimumILIASVersion()

ilPluginInfo::getMinimumILIASVersion ( )

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

157 : Version
158 {
160 }

References $minimum_ilias_version.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getName()

ilPluginInfo::getName ( )

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

102 : string
103 {
104 return $this->name;
105 }

References $name.

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

+ Here is the caller graph for this function:

◆ getPath()

ilPluginInfo::getPath ( )

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

112 : string
113 {
114 return implode('/', [
116 $this->getType(),
117 $this->getComponent()->getName(),
118 $this->getPluginSlot()->getName(),
119 $this->getName()
120 ]);
121 }

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

+ Here is the call graph for this function:

◆ getPluginSlot()

ilPluginInfo::getPluginSlot ( )

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

88 {
89 return $this->pluginslot;
90 }
Simple value class for basic information about a pluginslot.

References $pluginslot.

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

+ Here is the caller graph for this function:

◆ getReasonForInactivity()

ilPluginInfo::getReasonForInactivity ( )

Which is the reason for the inactivity?

Exceptions

LogicException if plugin is actually active.

Returns
string to be used as identifier for language service.

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

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 }
isInstalled()
"Installed" tells if the plugin has some installed version.
isActive()
Is this plugin active right now?
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.
isActivated()
"activated" tells if the administrator of the installation wants the plugin to be effective.
isVersionToOld()
"Version to old" tells if the plugin code has a version that is below the version that was updated la...

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

+ Here is the call graph for this function:

◆ getResponsible()

ilPluginInfo::getResponsible ( )

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

167 : string
168 {
169 return $this->responsible;
170 }

References $responsible.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getResponsibleMail()

ilPluginInfo::getResponsibleMail ( )

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

172 : string
173 {
175 }

References $responsible_mail.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ getType()

ilPluginInfo::getType ( )

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

107 : string
108 {
109 return $this->type;
110 }

References $type.

Referenced by getPath().

+ 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.

137 : bool
138 {
139 return $this->activated;
140 }

References $activated.

Referenced by getReasonForInactivity(), and isActive().

+ 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.

231 : bool
232 {
233 return $this->isCompliantToILIAS()
234 && $this->isInstalled()
235 && !$this->isVersionToOld()
236 && !$this->isUpdateRequired();
237 }

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

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

+ 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.

242 : bool
243 {
244 return $this->isActivationPossible()
245 && $this->isActivated();
246 }
isActivationPossible()
Can this plugin be activated right now.

References isActivated(), and isActivationPossible().

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

+ 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.

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 }

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

+ 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.

195 : bool
196 {
197 return $this->current_version !== null;
198 }

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

+ 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.

203 : bool
204 {
205 return $this->isInstalled() && !$this->current_version->equals($this->available_version);
206 }

References isInstalled().

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

+ 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.

212 : bool
213 {
214 return $this->current_version->isGreaterThan($this->available_version);
215 }

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

+ Here is the caller graph for this function:

◆ supportsCLISetup()

ilPluginInfo::supportsCLISetup ( )

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

187 : bool
188 {
190 }

References $supports_cli_setup.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ supportsExport()

ilPluginInfo::supportsExport ( )

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

182 : bool
183 {
185 }

References $supports_export.

Referenced by ilPluginsOverviewTable\getContent().

+ Here is the caller graph for this function:

◆ supportsLearningProgress()

ilPluginInfo::supportsLearningProgress ( )

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

177 : bool
178 {
180 }

References $supports_learning_progress.

Referenced by ilPluginsOverviewTable\getContent().

+ 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: