internal package
Foswiki::Configure::Dependency
On this page:
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 fortype=perl
- If a qualified
-
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.