Neriderc / GVExport

Repository for GVExport module for Webtrees
GNU General Public License v2.0
15 stars 6 forks source link

Version management #69

Closed hartenthaler closed 2 years ago

hartenthaler commented 2 years ago

GVExport does not support the standard webtrees version management system, so that there is no indication for an admin that there is a new version of this module available.

Neriderc commented 2 years ago

Do you know of something I could review to help me implement this? Is there documentation on this system and how to add it? Or another module that you could point me to the right part of it to use as a reference?

hartenthaler commented 2 years ago

You can use my module "extended family" for example.

You have to add a text file in the root of GVExpprt with the name latest-version.txt that contains always the actual released version number "2.1.8".

In my file ExtendedFamilyTabModule.php you can see two functions and two used strings (CUSTOM_MODULE is "GVExport" in your case). You can add the two functions without modifications.

    public const CUSTOM_VERSION     = '2.1.5.4';
    public const CUSTOM_LAST        = 'https://github.com/hartenthaler/' . self::CUSTOM_MODULE. '/raw/main/latest-version.txt';

    /**
     * The version of this module.
     *
     * @return string
     */
    public function customModuleVersion(): string
    {
        return self::CUSTOM_VERSION;
    }

    /**
     * A URL that will provide the latest version of this module.
     *
     * @return string
     */
    public function customModuleLatestVersionUrl(): string
    {
        return self::CUSTOM_LAST;
    }

If those functions are there webtrees will check the version and show a hint for the admin if there is a newer version available,

Neriderc commented 2 years ago

Fantastic! Thanks for this, I'll put this on the to-do list.