X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FAddon.php;h=14b163f165db2c3a77fbd4c3544d5bf34d7d3447;hb=62c79e1c4f1d48310b9df102777812a3e2310bae;hp=ee89f4d77235b189831072d265c40eeafad45609;hpb=8f9c0fe14956efbcaf0db9dbfb83222e18e0ab2f;p=friendica.git diff --git a/src/Core/Addon.php b/src/Core/Addon.php index ee89f4d772..14b163f165 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -12,6 +12,12 @@ use Friendica\Database\DBA; */ class Addon extends BaseObject { + /** + * The addon sub-directory + * @var string + */ + const DIRECTORY = 'addon'; + /** * List of the names of enabled addons * @@ -70,7 +76,8 @@ class Addon extends BaseObject * @brief uninstalls an addon. * * @param string $addon name of the addon - * @return boolean + * @return void + * @throws \Exception */ public static function uninstall($addon) { @@ -91,6 +98,7 @@ class Addon extends BaseObject * * @param string $addon name of the addon * @return bool + * @throws \Exception */ public static function install($addon) { @@ -190,6 +198,7 @@ class Addon extends BaseObject * *\endcode * @param string $addon the name of the addon * @return array with the addon information + * @throws \Exception */ public static function getInfo($addon) { @@ -269,6 +278,7 @@ class Addon extends BaseObject * Saves the current enabled addon list in the system.addon config key * * @return boolean + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function saveEnabledList() { @@ -279,6 +289,7 @@ class Addon extends BaseObject * Returns the list of non-hidden enabled addon names * * @return array + * @throws \Exception */ public static function getVisibleList() { @@ -296,13 +307,14 @@ class Addon extends BaseObject /** * Shim of Hook::register left for backward compatibility purpose. * - * @see Hook::register + * @see Hook::register * @deprecated since version 2018.12 * @param string $hook the name of the hook * @param string $file the name of the file that hooks into * @param string $function the name of the function that the hook will call * @param int $priority A priority (defaults to 0) * @return mixed|bool + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function registerHook($hook, $file, $function, $priority = 0) { @@ -312,12 +324,13 @@ class Addon extends BaseObject /** * Shim of Hook::unregister left for backward compatibility purpose. * - * @see Hook::unregister + * @see Hook::unregister * @deprecated since version 2018.12 * @param string $hook the name of the hook * @param string $file the name of the file that hooks into * @param string $function the name of the function that the hook called * @return boolean + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function unregisterHook($hook, $file, $function) { @@ -327,10 +340,11 @@ class Addon extends BaseObject /** * Shim of Hook::callAll left for backward-compatibility purpose. * - * @see Hook::callAll + * @see Hook::callAll * @deprecated since version 2018.12 - * @param string $name of the hook to call + * @param string $name of the hook to call * @param string|array &$data to transmit to the callback handler + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function callHooks($name, &$data = null) {