internal package Foswiki::Configure::Dependency

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Configure::Dependency

This module defines a dependency required by a Foswiki module and provides functions to test if the dependency is installed, and compare versions with the required version.

It is also used to examine the installed version of a Foswiki module.

ClassMethod new( %opts )

Create an object instance representing a single dependency, as read from DEPENDENCIES
  • %opts
    • name             => unqualified name e.g. SafeWikiPlugin
    • module           => qualified module e.g Foswiki::Plugins::SafeWikiPlugin
      • If a qualified module is not provided, all possible Foswiki/TWiki module types are searched for type=perl
    • type             => perl|cpan|external
      • perl is a Foswiki or TWiki module. external is used for any program other than a perl module. External dependencies are not checked.
    • version          => version condition e.g. ">1.2.3"
    • trigger          => ONLYIF condition (Specifies a version of another module, such as the Foswiki Func API)
    • description      => text

  • Instance variables set by calling studyInstallation() or indirectly by calling check()
    • installedVersion => $VERSION string from module
    • installedRelease => $RELEASE string from module (or $VERSION)
    • notes            => text   Notes on condition of module (ex. fails due to missing dependency)

ObjectMethod check()

Check whether the dependency is satisfied by a currently-installed module.
  • Return: ($ok, $msg)
    • $ok is a boolean indicating success/failure
    • $msg is a helpful message describing the failure
    • $release is the installed release of the module, as determined from the values of $RELEASE and $VERSION in the module.

ObjectMethod studyInstallation()

Check the current installation, populating the {installedRelease} and {installedVersion} fields, and returning true if the extension is installed. {notes} will also be set when certain conditions are discovered (example: missing dependencies or other compile failures).

  • Return: $ok
    • $ok is a boolean indicating success/failure. If the module is found and a VERSION and RELEASE are discovered, the method returns true.

ObjectMethod compare_versions ($condition, $release)

Compare versions (provided as $RELEASE, $VERSION) with a release specifier

Returns the boolean result of the comparison

Topic revision: r1 - 19 Apr 2011, ProjectContributor
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback