19declare(strict_types=1);
64 throw new \InvalidArgumentException(
65 "If there is no current version for the plugin, we also should not " .
94 return $this->pluginslot->getComponent();
135 foreach (explode(
'/', $path) as $segment) {
136 if ($segment ===
'' || $segment ===
'.') {
139 if ($segment ===
'..' && $segments !== [] && end($segments) !==
'..') {
140 array_pop($segments);
143 $segments[] = $segment;
146 return (str_starts_with($path,
'/') ?
'/' :
'') . implode(
'/', $segments);
151 return "il" . $this->
getName() .
"Plugin";
156 return "il" . $this->
getName() .
"ConfigGUI";
223 return $this->current_version !==
null;
231 return $this->
isInstalled() && !$this->current_version->equals($this->available_version);
240 return $this->current_version->isGreaterThan($this->available_version);
250 $this->actual_ilias_version->isGreaterThanOrEquals($this->minimum_ilias_version)
251 && $this->actual_ilias_version->isSmallerThanOrEquals($this->maximum_ilias_version);
283 throw new \LogicException(
284 "Plugin is active, so no reason for inactivity."
289 return "cmps_needs_matching_ilias_version";
293 return "cmps_must_installed";
297 return "cmps_needs_upgrade";
301 return "cmps_needs_update";
305 return "cmps_not_activated";
308 throw new \LogicException(
309 "Unknown reason for inactivity of the plugin."
A version number that consists of three numbers (major, minor, patch).
Simple value class for basic information about a component.
Simple value class for information about a plugin.
isInstalled()
"Installed" tells if the plugin has some installed version.
isActive()
Is this plugin active right now?
getReasonForInactivity()
Which is the reason for the inactivity?
Version $maximum_ilias_version
isCompliantToILIAS()
"ILIAS Version compliance" tells if the plugin can be operated with the given ILIAS version.
isActivationPossible()
Can this plugin be activated right now.
Version $available_version
bool $supports_learning_progress
ilPluginSlotInfo $pluginslot
isUpdateRequired()
"Update required" tells if the plugin needs an update.
normalizePath(string $path)
Resolves "." and ".." segments without touching the file system, so it also works for plugins which a...
Version $minimum_ilias_version
supportsLearningProgress()
isActivated()
"activated" tells if the administrator of the installation wants the plugin to be effective.
__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)
Version $actual_ilias_version
isVersionToOld()
"Version to old" tells if the plugin code has a version that is below the version that was updated la...
Simple value class for basic information about a pluginslot.