/[pub]/suikawiki/script/default/suikawiki-config.ph
Suika

Contents of /suikawiki/script/default/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sun Feb 1 12:34:18 2004 UTC (21 years, 3 months ago) by wakaba
Branch: MAIN
Changes since 1.9: +75 -77 lines
Remove some obsoleted configuration options

1 =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 use strict;
22
23 sub config ($) {
24 my $WIKI = shift;
25
26 ## -- Filesystem path mapping
27 for (
28 [db__cache__dir => q"./wikidata/lock/"],
29 [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 ## -- Debug mode
37 $WIKI->{config}->{debug} = {
38 general => 1,
39 db => 0,
40 view => 1,
41 };
42
43 ## -- WikiPlugin
44 push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {
45 my $wiki = shift;
46
47 ## Installed plugin modules
48 $wiki->{plugin}->load_directory (qw(
49 lib/SuikaWiki/Plugin/
50 misc/plugins/
51 misc/plugins/form/
52 misc/plugins/format/
53 misc/plugins/link/
54 misc/plugins/view/
55 ));
56
57 ## Configuration file as pseudo-plugin module
58 require 'wikidata/config.ph';
59 };
60
61 ## -- WikiDatabase: Mapping logical to physical
62 push @{$WIKI->{event}->{database_loaded}}, sub {
63 my $wiki = shift;
64
65 ## Main content
66 $wiki->{db}->_set_prop_db (content => {-db_open => sub {
67 require SuikaWiki::DB::FileSystem::YukiWikiDBNS;
68 SuikaWiki::DB::FileSystem::YukiWikiDBNS->new
69 (directory => $wiki->{config}->{path_to}->{db__content__dir},
70 logfile => $wiki->{config}->{path_to}->{db__content__error_log},
71 suffix => '.txt',
72 -lock => $wiki->{var}->{db}->{lock_prop}->('content'));
73 }, -db_close => sub {
74 my %opt = @_;
75 $opt{prop_info}->{-db}->close;
76 delete $opt{prop_info}->{-db};
77 }});
78
79 ## Last modified
80 $wiki->{db}->_set_prop_db (lastmodified => {-db_open => sub {
81 require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09;
82 SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new
83 (directory => $wiki->{config}->{path_to}->{db__content__dir},
84 -lock => $wiki->{var}->{db}->{lock_prop}->('lastmodified'));
85 }, -prop => 'last_modified', -db_close => sub {
86 my %opt = @_;
87 $opt{prop_info}->{-db}->close;
88 delete $opt{prop_info}->{-db};
89 }});
90
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 };
111
112 ## -- WikiName of special purpose WikiPages
113 $WIKI->{config}->{page} = {
114 Default => [qw/HomePage/],
115 InterWikiName => [qw/Wiki InterWikiName/],
116 NewPageTemplate => [qw/Wiki NewPageTemplate/],
117 };
118
119 ## -- WikiNamespace constants
120 $WIKI->{config}->{name}->{space}->{separator} = '//';
121 $WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#;
122
123 ## -- Default character codes
124 $WIKI->{config}->{charset}->{internal} = 'euc-jp';
125 $WIKI->{config}->{charset}->{output} = 'iso-2022-jp';
126 $WIKI->{config}->{charset}->{uri_param} = ''; # auto detect
127 $WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp';
128 $WIKI->{config}->{charset}->{uri_query} = ''; # auto detect
129 $WIKI->{config}->{charset}->{uri_query_encode} = 'euc-jp';
130 $WIKI->{config}->{charset}->{uri_path_info} = 'utf-8';
131
132 ## -- Expires duration templates
133 $WIKI->{config}->{entity}->{expires} = {
134 edit => {delta => 60},
135 view => {delta => 2*3600},
136 lm_flaged => {delta => 30*24*3600},
137 };
138
139 }
140
141 =head1 SEE ALSO
142
143 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
147 =head1 LICENSE
148
149 Copyright 2003-2004 Wakaba <w@suika.fam.cx>. All rights reserved.
150
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
156 1; # $Date: 2004/01/16 08:06:53 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24