Loading docs/src/content/docs/en/plugins/manifest.mdx +4 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ directories should refuse to publish the plugin. Array of strings to help your plugin get discovered when listed in repositories. ### minCastopodVersion The minimal version of Castopod with which the plugin is compatible. ### hooks List of hooks used by the plugin. If the hook is not specified, Castopod will Loading modules/Plugins/Core/BasePlugin.php +15 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,16 @@ abstract class BasePlugin implements PluginInterface $this->manifest = new Manifest($this->key); $this->manifest->loadFromFile($manifestPath); // check compatibility with Castopod version if ($this->manifest->minCastopodVersion !== null && version_compare( CP_VERSION, $this->manifest->minCastopodVersion, '<' )) { $this->status = PluginStatus::INCOMPATIBLE; } else { $this->status = get_plugin_setting($this->key, 'active') ? PluginStatus::ACTIVE : PluginStatus::INACTIVE; } $this->iconSrc = $this->loadIcon($directory . '/icon.svg'); Loading Loading @@ -214,6 +223,11 @@ abstract class BasePlugin implements PluginInterface return $settings->{$type}; } final public function getMinCastopodVersion(): string { return $this->manifest->minCastopodVersion ?? ''; } /** * @return list<string> */ Loading modules/Plugins/Core/PluginStatus.php +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ namespace Modules\Plugins\Core; enum PluginStatus: string { case INVALID = 'invalid'; case INCOMPATIBLE = 'incompatible'; case INACTIVE = 'inactive'; case ACTIVE = 'active'; } modules/Plugins/Core/Plugins.php +0 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ use Modules\Plugins\Config\Plugins as PluginsConfig; */ class Plugins { public const API_VERSION = '1.0'; /** * @var list<string> */ Loading modules/Plugins/Language/en/Plugins.php +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ return [ 'active' => 'Active', 'inactive' => 'Inactive', 'invalid' => 'Invalid', 'incompatible' => 'Incompatible', 'incompatible_hint' => 'Plugin requires Castopod v{minCastopodVersion} minimum.', 'uninstall' => 'Uninstall', 'keywords' => [ 'podcasting20' => 'Podcasting 2.0', Loading Loading
docs/src/content/docs/en/plugins/manifest.mdx +4 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ directories should refuse to publish the plugin. Array of strings to help your plugin get discovered when listed in repositories. ### minCastopodVersion The minimal version of Castopod with which the plugin is compatible. ### hooks List of hooks used by the plugin. If the hook is not specified, Castopod will Loading
modules/Plugins/Core/BasePlugin.php +15 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,16 @@ abstract class BasePlugin implements PluginInterface $this->manifest = new Manifest($this->key); $this->manifest->loadFromFile($manifestPath); // check compatibility with Castopod version if ($this->manifest->minCastopodVersion !== null && version_compare( CP_VERSION, $this->manifest->minCastopodVersion, '<' )) { $this->status = PluginStatus::INCOMPATIBLE; } else { $this->status = get_plugin_setting($this->key, 'active') ? PluginStatus::ACTIVE : PluginStatus::INACTIVE; } $this->iconSrc = $this->loadIcon($directory . '/icon.svg'); Loading Loading @@ -214,6 +223,11 @@ abstract class BasePlugin implements PluginInterface return $settings->{$type}; } final public function getMinCastopodVersion(): string { return $this->manifest->minCastopodVersion ?? ''; } /** * @return list<string> */ Loading
modules/Plugins/Core/PluginStatus.php +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ namespace Modules\Plugins\Core; enum PluginStatus: string { case INVALID = 'invalid'; case INCOMPATIBLE = 'incompatible'; case INACTIVE = 'inactive'; case ACTIVE = 'active'; }
modules/Plugins/Core/Plugins.php +0 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ use Modules\Plugins\Config\Plugins as PluginsConfig; */ class Plugins { public const API_VERSION = '1.0'; /** * @var list<string> */ Loading
modules/Plugins/Language/en/Plugins.php +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ return [ 'active' => 'Active', 'inactive' => 'Inactive', 'invalid' => 'Invalid', 'incompatible' => 'Incompatible', 'incompatible_hint' => 'Plugin requires Castopod v{minCastopodVersion} minimum.', 'uninstall' => 'Uninstall', 'keywords' => [ 'podcasting20' => 'Podcasting 2.0', Loading