@@ -32,11 +32,6 @@ our $ITEMREGEX = qr/(?:\{(?:'(?:\\.|[^'])+'|"(?:\\.|[^"])+"|[A-Za-z0-9_]+)\})+/;
32
32
our $TRUE = 1;
33
33
our $FALSE = 0;
34
34
35
- # Bootstrap works out the correct values of these keys
36
- my @BOOTSTRAP =
37
- qw( {DataDir} {DefaultUrlHost} {PubUrlPath} {ToolsDir} {WorkingDir}
38
- {PubDir} {TemplateDir} {ScriptDir} {ScriptUrlPath} {ScriptUrlPaths}{view} {ScriptSuffix} {LocalesDir} ) ;
39
-
40
35
# Configuration items that have been deprecated and must be mapped to
41
36
# new configuration items. The value is mapped unchanged.
42
37
our %remap = (
@@ -306,6 +301,30 @@ sub _handleExpand {
306
301
307
302
=begin TML
308
303
304
+ ---++ StaticMethod setBootstrap()
305
+
306
+ This routine is called to initialize the bootstrap process. It sets the list of
307
+ configuration parameters that will need to be set and "protected" during bootstrap.
308
+
309
+ If any keys will be set during bootstrap / initial creation of LocalSite.cfg, they
310
+ should be added here so that they are preserved when the %Foswiki::cfg hash is
311
+ wiped and re-initialized from the Foswiki spec.
312
+
313
+ =cut
314
+
315
+ sub setBootstrap {
316
+
317
+ # Bootstrap works out the correct values of these keys
318
+ my @BOOTSTRAP =
319
+ qw( {DataDir} {DefaultUrlHost} {PubUrlPath} {ToolsDir} {WorkingDir}
320
+ {PubDir} {TemplateDir} {ScriptDir} {ScriptUrlPath} {ScriptUrlPaths}{view} {ScriptSuffix} {LocalesDir} ) ;
321
+
322
+ $Foswiki::cfg {isBOOTSTRAPPING } = 1;
323
+ push ( @{ $Foswiki::cfg {BOOTSTRAP } }, @BOOTSTRAP );
324
+ }
325
+
326
+ =begin TML
327
+
309
328
---++ StaticMethod bootstrapConfig( $noload )
310
329
311
330
This routine is called from Foswiki.pm BEGIN block to discover the mandatory
@@ -564,9 +583,8 @@ EPITAPH
564
583
565
584
_workOutOS();
566
585
567
- $Foswiki::cfg {isVALID } = 1;
568
- $Foswiki::cfg {isBOOTSTRAPPING } = 1;
569
- push ( @{ $Foswiki::cfg {BOOTSTRAP } }, @BOOTSTRAP );
586
+ $Foswiki::cfg {isVALID } = 1;
587
+ Foswiki::Configure::Load::setBootstrap();
570
588
eval ' require Foswiki::Plugins::ConfigurePlugin' ;
571
589
die
572
590
" LocalSite.cfg load failed, and ConfigurePlugin could not be loaded: $@ "
@@ -596,7 +614,7 @@ BOOTS
596
614
597
615
---++ StaticMethod findDependencies(\%cfg) -> \%deps
598
616
599
- * =\%cfg= configuration hash to scan; defaults to %Foswiki::cfg
617
+ * =\%cfg= configuration hash to scan; defaults to %Foswiki::cfg
600
618
601
619
Recursively locate references to other keys in the values of keys.
602
620
Returns a hash containing two keys:
0 commit comments