1 |
wakaba |
1.10 |
=head1 NAME |
2 |
|
|
|
3 |
|
|
suikawiki-config.ph - SuikaWiki: Configuration for SuikaWiki HTTP CGI Driver |
4 |
|
|
|
5 |
|
|
=head1 DESCRIPTION |
6 |
|
|
|
7 |
|
|
This is a configuration file for SuikaWiki Driver for HTTP CGI Script |
8 |
|
|
(SWHCS). Basic options such as WikiDB directory mapping and |
9 |
|
|
special purpose WikiPage names can be customized with this file. |
10 |
|
|
|
11 |
|
|
More complex customizing, e.g. modifying navigation bar or |
12 |
|
|
adding new mode, is also possible by config.ph (generated from |
13 |
|
|
config.wp2) and WikiPlugin modules. For more information, |
14 |
|
|
see <http://suika.fam.cx/~wakaba/-temp/wiki/wiki?SuikaWiki>. |
15 |
|
|
|
16 |
|
|
This file is part of SuikaWiki. |
17 |
|
|
|
18 |
|
|
=cut |
19 |
|
|
|
20 |
|
|
package wiki::driver::http; |
21 |
w |
1.1 |
use strict; |
22 |
wakaba |
1.4 |
|
23 |
wakaba |
1.10 |
sub config ($) { |
24 |
|
|
my $WIKI = shift; |
25 |
|
|
|
26 |
|
|
## -- Filesystem path mapping |
27 |
wakaba |
1.6 |
for ( |
28 |
wakaba |
1.10 |
[db__cache__dir => q"./wikidata/lock/"], |
29 |
wakaba |
1.6 |
[db__content__dir => q"./wikidata/page"], |
30 |
|
|
[db__content__error_log => q"./wikidata/log/db-content.log"], |
31 |
|
|
[db__lock__dir => q"./wikidata/lock/"], |
32 |
|
|
) { |
33 |
|
|
$WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; |
34 |
|
|
} |
35 |
|
|
|
36 |
wakaba |
1.10 |
## -- Debug mode |
37 |
wakaba |
1.8 |
$WIKI->{config}->{debug} = { |
38 |
|
|
general => 1, |
39 |
|
|
db => 0, |
40 |
wakaba |
1.9 |
view => 1, |
41 |
wakaba |
1.8 |
}; |
42 |
|
|
|
43 |
wakaba |
1.10 |
## -- WikiPlugin |
44 |
wakaba |
1.6 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
45 |
wakaba |
1.8 |
my $wiki = shift; |
46 |
wakaba |
1.10 |
|
47 |
|
|
## Installed plugin modules |
48 |
wakaba |
1.8 |
$wiki->{plugin}->load_directory (qw( |
49 |
|
|
lib/SuikaWiki/Plugin/ |
50 |
|
|
misc/plugins/ |
51 |
wakaba |
1.10 |
misc/plugins/form/ |
52 |
wakaba |
1.9 |
misc/plugins/format/ |
53 |
wakaba |
1.10 |
misc/plugins/link/ |
54 |
wakaba |
1.8 |
misc/plugins/view/ |
55 |
|
|
)); |
56 |
wakaba |
1.10 |
|
57 |
|
|
## Configuration file as pseudo-plugin module |
58 |
wakaba |
1.6 |
require 'wikidata/config.ph'; |
59 |
|
|
}; |
60 |
|
|
|
61 |
wakaba |
1.10 |
## -- WikiDatabase: Mapping logical to physical |
62 |
wakaba |
1.6 |
push @{$WIKI->{event}->{database_loaded}}, sub { |
63 |
wakaba |
1.10 |
my $wiki = shift; |
64 |
|
|
|
65 |
wakaba |
1.6 |
## Main content |
66 |
wakaba |
1.10 |
$wiki->{db}->_set_prop_db (content => {-db_open => sub { |
67 |
wakaba |
1.6 |
require SuikaWiki::DB::FileSystem::YukiWikiDBNS; |
68 |
|
|
SuikaWiki::DB::FileSystem::YukiWikiDBNS->new |
69 |
wakaba |
1.10 |
(directory => $wiki->{config}->{path_to}->{db__content__dir}, |
70 |
|
|
logfile => $wiki->{config}->{path_to}->{db__content__error_log}, |
71 |
wakaba |
1.6 |
suffix => '.txt', |
72 |
wakaba |
1.10 |
-lock => $wiki->{var}->{db}->{lock_prop}->('content')); |
73 |
wakaba |
1.8 |
}, -db_close => sub { |
74 |
|
|
my %opt = @_; |
75 |
|
|
$opt{prop_info}->{-db}->close; |
76 |
|
|
delete $opt{prop_info}->{-db}; |
77 |
|
|
}}); |
78 |
wakaba |
1.6 |
|
79 |
|
|
## Last modified |
80 |
wakaba |
1.10 |
$wiki->{db}->_set_prop_db (lastmodified => {-db_open => sub { |
81 |
wakaba |
1.6 |
require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09; |
82 |
|
|
SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new |
83 |
wakaba |
1.10 |
(directory => $wiki->{config}->{path_to}->{db__content__dir}, |
84 |
|
|
-lock => $wiki->{var}->{db}->{lock_prop}->('lastmodified')); |
85 |
wakaba |
1.8 |
}, -prop => 'last_modified', -db_close => sub { |
86 |
|
|
my %opt = @_; |
87 |
|
|
$opt{prop_info}->{-db}->close; |
88 |
|
|
delete $opt{prop_info}->{-db}; |
89 |
|
|
}}); |
90 |
wakaba |
1.10 |
|
91 |
|
|
## Cache |
92 |
|
|
require SuikaWiki::DB::FileSystem::SuikaWikiCache09; |
93 |
|
|
my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new |
94 |
|
|
(directory => $wiki->{config}->{path_to}->{db__cache__dir}); |
95 |
|
|
$wiki->{db}->_set_prop_db (m__search_result => |
96 |
|
|
{-db => $cachedb, -prop => 'search_result', -db_close => sub { |
97 |
|
|
my %opt = @_; |
98 |
|
|
$opt{prop_info}->{-db}->close; |
99 |
|
|
delete $opt{prop_info}->{-db}; |
100 |
|
|
}}); |
101 |
|
|
$wiki->{db}->_set_prop_db (wpp__headsummary => |
102 |
|
|
{-db => $cachedb, -prop => 'headsummary', -db_close => sub { |
103 |
|
|
my %opt = @_; |
104 |
|
|
$opt{prop_info}->{-db}->close; |
105 |
|
|
delete $opt{prop_info}->{-db}; |
106 |
|
|
}}); |
107 |
|
|
|
108 |
|
|
## Additional WikiDB properties should be defined here |
109 |
|
|
# ... |
110 |
wakaba |
1.6 |
}; |
111 |
|
|
|
112 |
wakaba |
1.10 |
## -- WikiName of special purpose WikiPages |
113 |
wakaba |
1.8 |
$WIKI->{config}->{page} = { |
114 |
|
|
Default => [qw/HomePage/], |
115 |
wakaba |
1.10 |
InterWikiName => [qw/Wiki InterWikiName/], |
116 |
wakaba |
1.8 |
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
117 |
|
|
}; |
118 |
|
|
|
119 |
wakaba |
1.10 |
## -- WikiNamespace constants |
120 |
wakaba |
1.7 |
$WIKI->{config}->{name}->{space}->{separator} = '//'; |
121 |
|
|
$WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; |
122 |
|
|
|
123 |
wakaba |
1.10 |
## -- Default character codes |
124 |
wakaba |
1.6 |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
125 |
|
|
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
126 |
|
|
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
127 |
wakaba |
1.8 |
$WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp'; |
128 |
wakaba |
1.6 |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
129 |
wakaba |
1.8 |
$WIKI->{config}->{charset}->{uri_query_encode} = 'euc-jp'; |
130 |
|
|
$WIKI->{config}->{charset}->{uri_path_info} = 'utf-8'; |
131 |
wakaba |
1.7 |
|
132 |
wakaba |
1.10 |
## -- Expires duration templates |
133 |
wakaba |
1.6 |
$WIKI->{config}->{entity}->{expires} = { |
134 |
wakaba |
1.7 |
edit => {delta => 60}, |
135 |
|
|
view => {delta => 2*3600}, |
136 |
wakaba |
1.6 |
lm_flaged => {delta => 30*24*3600}, |
137 |
|
|
}; |
138 |
wakaba |
1.4 |
|
139 |
wakaba |
1.10 |
} |
140 |
wakaba |
1.8 |
|
141 |
wakaba |
1.10 |
=head1 SEE ALSO |
142 |
w |
1.3 |
|
143 |
wakaba |
1.10 |
C<lib/suikawiki.pl>, C<wiki.cgi>, |
144 |
|
|
<http://suika.fam.cx/~wakaba/-temp/wiki/wiki?SuikaWiki>, |
145 |
|
|
<http://suika.fam.cx/~wakaba/-temp/wiki/wiki?SWHCS> |
146 |
w |
1.3 |
|
147 |
|
|
=head1 LICENSE |
148 |
|
|
|
149 |
wakaba |
1.10 |
Copyright 2003-2004 Wakaba <w@suika.fam.cx>. All rights reserved. |
150 |
w |
1.3 |
|
151 |
|
|
This program is free software; you can redistribute it and/or |
152 |
|
|
modify it under the same terms as Perl itself. |
153 |
|
|
|
154 |
|
|
=cut |
155 |
w |
1.1 |
|
156 |
wakaba |
1.10 |
1; # $Date: 2004/01/16 08:06:53 $ |