data/TWiki/TWikiConfigureLoadDotPm.txt,v
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
head	1.1;
colas@0
     2
access;
colas@0
     3
symbols;
colas@0
     4
locks; strict;
colas@0
     5
comment	@# @;
colas@0
     6
colas@0
     7
colas@0
     8
1.1
colas@0
     9
date	2007.01.16.04.12.00;	author TWikiContributor;	state Exp;
colas@0
    10
branches;
colas@0
    11
next	;
colas@0
    12
colas@0
    13
colas@0
    14
desc
colas@0
    15
@buildrelease
colas@0
    16
@
colas@0
    17
colas@0
    18
colas@0
    19
1.1
colas@0
    20
log
colas@0
    21
@buildrelease
colas@0
    22
@
colas@0
    23
text
colas@0
    24
@---+ Package =TWiki::Configure::Load=
colas@0
    25
colas@0
    26
---++ Purpose
colas@0
    27
colas@0
    28
This module consists of just a single subroutine =readConfig=.  It allows to
colas@0
    29
safely modify configuration variables _for one single run_ without affecting
colas@0
    30
normal TWiki operation.
colas@0
    31
colas@0
    32
colas@0
    33
%TOC%
colas@0
    34
colas@0
    35
---++ StaticMethod *readConfig* <tt>()</tt>
colas@0
    36
colas@0
    37
In normal TWiki operations as a web server this routine is called by the
colas@0
    38
=BEGIN= block of =TWiki.pm=.  However, when benchmarking/debugging it can be
colas@0
    39
replaced by custom code which sets the configuration hash.  To prevent us from
colas@0
    40
overriding the custom code again, we use an "unconfigurable" key
colas@0
    41
=$cfg{ConfigurationFinished}= as an indicator.
colas@0
    42
colas@0
    43
Note that this method is called by TWiki and configure, and *only* reads
colas@0
    44
TWiki.spec= to get defaults. Other spec files (those for extensions) are
colas@0
    45
*not* read.
colas@0
    46
colas@0
    47
The assumption is that =configure= will be run when an extension is installed,
colas@0
    48
and that will add the config values to LocalSite.cfg, so no defaults are
colas@0
    49
needed. TWiki.spec is still read because so much of the core code doesn't
colas@0
    50
provide defaults, and it would be silly to have them in two places anyway.
colas@0
    51
colas@0
    52
colas@0
    53
colas@0
    54
---++ StaticMethod *expandValue* <tt>($string) -> $boolean</tt>
colas@0
    55
colas@0
    56
Expands references to TWiki configuration items which occur in the
colas@0
    57
value of other configuration items.  Use expand($hashref) if the item
colas@0
    58
is not a plain scalar.
colas@0
    59
colas@0
    60
Happens to return true if something has been expanded, though I don't
colas@0
    61
know whether you would want that.  The replacement is done in-place,
colas@0
    62
colas@0
    63
colas@0
    64
colas@0
    65
---++ StaticMethod *readDefaults* <tt>() -> \@@errors</tt>
colas@0
    66
colas@0
    67
This is only called by =configure= to initialise the TWiki config hash with
colas@0
    68
default values from the .spec files.
colas@0
    69
colas@0
    70
Normally all configuration values come from LocalSite.cfg. However when
colas@0
    71
=configure= runs it has to get default values for config vars that have not
colas@0
    72
yet been saved to =LocalSite.cfg=.
colas@0
    73
colas@0
    74
Returns a reference to a list of the errors it saw.
colas@0
    75
colas@0
    76
SEE ALSO: TWiki::Configure::TWikiCfg::load
colas@0
    77
colas@0
    78
colas@0
    79
@