internal package Foswiki::Configure::Load
Handling for loading configuration information (Foswiki.spec, Config.spec and
.cfg) as efficiently and flexibly as possible.
This reads values
from these files and does not
structured comments or build a spec database. For that, see LoadSpec
In normal Foswiki operations as a web server this method is called by the
. 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
as an indicator.
Note that this method is called by Foswiki and configure, and normally reads
to get defaults. Other spec files (those for extensions) are
read unless the $config_spec flag is set.
The assumption is that
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 - suppress expansion of $Foswiki vars embedded in values.
$nospec - can be set when the caller knows that Foswiki.spec has already been read.
$config_spec - if set, will also read Config.spec files located using the standard methods (iff !$nospec). Slow.
$noLocal - if set, Load will not re-read an existing LocalSite.cfg. this is needed when testing the bootstrap. If it rereads an existing config, it overlays all the bootstrapped settings.
StaticMethod expanded($value) → $expanded
Given a value of a configuration item, expand references to
$Foswiki::cfg configuration items within strings in the value.
If an embedded $Foswiki::cfg reference is not defined, it will
be expanded as 'undef'.
StaticMethod expandValue($datum [, $mode])
Expands references to Foswiki configuration items which occur in the
values configuration items contained within the datum, which may be a
hash or array reference, or a scalar value. The replacement is done in-place.
$mode - How to handle undefined values:
- false: 'undef' (string) is returned when an undefined value is encountered.
- 1 : return if any undefined value is encountered.
- 2 : return '' for any undefined value (including embedded)
- 3 : die if an undefined value is encountered.
StaticMethod findDependencies(\%cfg) → \%deps
\%cfg configuration hash to scan; defaults to %Foswiki::cfg
Recursively locate references to other keys in the values of keys.
Returns a hash containing two keys:
forward => a hash mapping keys to a list of the keys that depend on their value
reverse => a hash mapping keys to a list of keys whose value they depend on.
StaticMethod specChanged → @list
Find all the Spec files (Config.spec and Foswiki.spec) and return
a list of extensions with Spec files newer than LocalSite