33 |
|
|
34 |
push our @Config, sub ($) { |
push our @Config, sub ($) { |
35 |
my $WIKI = shift; |
my $WIKI = shift; |
36 |
use Cwd qw(abs_path); |
use FindBin q($Bin); |
37 |
|
use File::Spec; |
38 |
|
|
39 |
## -- Filesystem path mapping |
## -- Filesystem path mapping |
40 |
for ( |
for ( |
54 |
) { |
) { |
55 |
## On system that does not set current directory as main script |
## On system that does not set current directory as main script |
56 |
## directory, you should specify it instead of using "abs_path". |
## directory, you should specify it instead of using "abs_path". |
57 |
$WIKI->{config}->{path_to}->{$_->[0]} = abs_path $_->[1]; |
$WIKI->{config}->{path_to}->{$_->[0]} = File::Spec->catfile ($Bin, $_->[1]); |
58 |
} |
} |
59 |
|
|
60 |
=begin comment |
=begin comment |
76 |
|
|
77 |
=end comment |
=end comment |
78 |
|
|
79 |
|
=cut |
80 |
|
|
81 |
## -- WikiPlugin |
## -- WikiPlugin |
82 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
83 |
my $wiki = shift; |
my $wiki = shift; |
108 |
directory_suffix => '.ns', |
directory_suffix => '.ns', |
109 |
file_suffix => '.txt', |
file_suffix => '.txt', |
110 |
root_key => $wiki->{config}->{page}->{Default}, |
root_key => $wiki->{config}->{page}->{Default}, |
111 |
-lock => $wiki->{var}->{db}->{lock_prop}->('content_prop')); |
-lock => $wiki->{var}->{db}->{lock_prop}->('content')); |
112 |
}, -db_close => sub { |
}, -db_close => sub { |
113 |
my %opt = @_; |
my %opt = @_; |
114 |
$opt{prop_info}->{-db}->close; |
$opt{prop_info}->{-db}->close; |
123 |
directory_suffix => '.ns', |
directory_suffix => '.ns', |
124 |
file_suffix => '.prop', |
file_suffix => '.prop', |
125 |
root_key => $wiki->{config}->{page}->{Default}, |
root_key => $wiki->{config}->{page}->{Default}, |
126 |
-lock => $wiki->{var}->{db}->{lock_prop}->('content')); |
-lock => $wiki->{var}->{db}->{lock_prop}->('content_prop')); |
127 |
}, -db_close => sub { |
}, -db_close => sub { |
128 |
my %opt = @_; |
my %opt = @_; |
129 |
$opt{prop_info}->{-db}->close; |
$opt{prop_info}->{-db}->close; |
186 |
# ... |
# ... |
187 |
}; |
}; |
188 |
|
|
|
push @{$WIKI->{event}->{input_close}}, sub { |
|
|
my ($wiki, $event) = @_; |
|
|
try { |
|
|
SuikaWiki::Plugin->module_package ('Referer') |
|
|
->add_referer (wiki => $wiki, |
|
|
uri => $wiki->{input}->meta_variable |
|
|
('HTTP_REFERER')); |
|
|
} catch SuikaWiki::Plugin::error with { |
|
|
my $err = shift; |
|
|
$err->raise unless $err->{-type} eq 'PLUGIN_NOT_FOUND'; |
|
|
}; |
|
|
try { |
|
|
SuikaWiki::Plugin->module_package ('RequestLog') |
|
|
->http_request_log (wiki => $wiki, |
|
|
prop => 'log__http_request'); |
|
|
} catch SuikaWiki::Plugin::error with { |
|
|
my $err = shift; |
|
|
$err->raise unless $err->{-type} eq 'PLUGIN_NOT_FOUND'; |
|
|
}; |
|
|
}; |
|
|
|
|
189 |
## -- WikiName of special purpose WikiPages |
## -- WikiName of special purpose WikiPages |
190 |
$WIKI->{config}->{page} = { |
$WIKI->{config}->{page} = { |
191 |
Default => $WIKI->name ([qw/HomePage/]), |
Default => $WIKI->name ([qw/HomePage/]), |