internal package Foswiki::Configure::Load

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::Load

Handling for loading configuration information (Foswiki.spec, Config.spec and LocalSite.cfg) as efficiently and flexibly as possible.

StaticMethod readConfig([$noexpand])

In normal Foswiki operations as a web server this method is called by the BEGIN block of Foswiki.pm. However, when benchmarking/debugging it can be replaced by custom code which sets the configuration hash. To prevent us from overriding the custom code again, we use an "unconfigurable" key $cfg{ConfigurationFinished} as an indicator.

Note that this method is called by Foswiki and configure, and only reads Foswiki.spec= to get defaults. Other spec files (those for extensions) are not read.

The assumption is that configure will be run when an extension is installed, and that will add the config values to LocalSite.cfg, so no defaults are needed. Foswiki.spec is still read because so much of the core code doesn't provide defaults, and it would be silly to have them in two places anyway.

$noexpand can be set to suppress expansion of $Foswiki vars embedded in values.

StaticMethod expandValue($datum)

Expands references to Foswiki configuration items which occur in the values configuration items contained within the datum, which may be a hash reference or a scalar value. The replacement is done in-place.

StaticMethod readDefaults() → \@errors

This is only called by configure to initialise the Foswiki config hash with default values from the .spec files.

Normally all configuration values come from LocalSite.cfg. However when configure runs it has to get default values for config vars that have not yet been saved to LocalSite.cfg.

Returns a reference to a list of the errors it saw.

SEE ALSO: Foswiki::Configure::FoswikiCfg::load

Topic revision: r1 - 19 Apr 2011, ProjectContributor
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding FAIR Wiki? Send feedback