2 # Standard ikiwiki setup module.
3 # Parameters to import should be all the standard ikiwiki config stuff,
4 # plus an array of wrappers to set up.
11 package IkiWiki::Setup::Standard;
14 IkiWiki::setup_standard(@_);
22 $setup{plugin}=$config{plugin};
23 if (exists $setup{add_plugins}) {
24 push @{$setup{plugin}}, @{$setup{add_plugins}};
25 delete $setup{add_plugins};
27 if (exists $setup{exclude}) {
28 push @{$config{wiki_file_prune_regexps}}, $setup{exclude};
31 if (! $config{render} && (! $config{refresh} || $config{wrappers})) {
32 debug(gettext("generating wrappers.."));
33 my @wrappers=@{$setup{wrappers}};
34 delete $setup{wrappers};
35 my %startconfig=(%config);
36 foreach my $wrapper (@wrappers) {
37 %config=(%startconfig, rebuild => 0, verbose => 0, %setup, %{$wrapper});
39 if (! $config{cgi} && ! $config{post_commit}) {
40 $config{post_commit}=1;
44 %config=(%startconfig);
47 foreach my $c (keys %setup) {
48 next if $c eq 'syslog';
49 if (defined $setup{$c}) {
50 if (! ref $setup{$c}) {
51 $config{$c}=possibly_foolish_untaint($setup{$c});
53 elsif (ref $setup{$c} eq 'ARRAY') {
54 $config{$c}=[map { possibly_foolish_untaint($_) } @{$setup{$c}}]
56 elsif (ref $setup{$c} eq 'HASH') {
57 foreach my $key (keys %{$setup{$c}}) {
58 $config{$c}{$key}=possibly_foolish_untaint($setup{$c}{$key});
70 if ($config{render}) {
74 if (! $config{refresh}) {
76 debug(gettext("rebuilding wiki.."));
79 debug(gettext("refreshing wiki.."));
86 debug(gettext("done"));