]> git.mxchange.org Git - friendica.git/commitdiff
Add install, uninstall and reload in AddonHelper
authorArt4 <art4@wlabs.de>
Tue, 4 Feb 2025 08:03:32 +0000 (08:03 +0000)
committerArt4 <art4@wlabs.de>
Tue, 4 Feb 2025 08:03:32 +0000 (08:03 +0000)
src/Core/Addon/AddonHelper.php
src/Core/Addon/AddonProxy.php

index 98a999c23f05f1b8074f499a80dece8df7e9b9b6..1dd8dc93f52e6e502dcbad4903525f32ca9820dc 100644 (file)
@@ -23,6 +23,27 @@ interface AddonHelper
         */
        public function getAvailableAddons(): array;
 
+       /**
+        * Installs an addon.
+        *
+        * @param string $addonId name of the addon
+        *
+        * @return bool true on success or false on failure
+        */
+       public function installAdodn(string $addonId): bool;
+
+       /**
+        * Uninstalls an addon.
+        *
+        * @param string $addonId name of the addon
+        */
+       public function uninstallAddon(string $addonId): void;
+
+       /**
+        * Reload (uninstall and install) all updated addons.
+        */
+       public function reloadAddons(): void;
+
        /**
         * Checks if the provided addon is enabled
         */
index aaa6a2368941919053e94cd55f11cef33104cc2d..dead7cbb3edbd8cf216998b55be2d23a0f725cb6 100644 (file)
@@ -30,6 +30,36 @@ final class AddonProxy implements AddonHelper
                return Addon::getAvailableList();
        }
 
+       /**
+        * Installs an addon.
+        *
+        * @param string $addonId name of the addon
+        *
+        * @return bool true on success or false on failure
+        */
+       public function installAdodn(string $addonId): bool
+       {
+               return Addon::install($addonId);
+       }
+
+       /**
+        * Uninstalls an addon.
+        *
+        * @param string $addonId name of the addon
+        */
+       public function uninstallAddon(string $addonId): void
+       {
+               Addon::uninstall($addonId);
+       }
+
+       /**
+        * Reload (uninstall and install) all updated addons.
+        */
+       public function reloadAddons(): void
+       {
+               Addon::reload();
+       }
+
        /**
         * Checks if the provided addon is enabled
         */