/[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.11 - (hide annotations) (download)
Sun Feb 8 09:01:57 2004 UTC (21 years, 3 months ago) by wakaba
Branch: MAIN
Changes since 1.10: +35 -20 lines
Namespace option added

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 ## -- WikiPlugin
37 wakaba 1.6 push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {
38 wakaba 1.8 my $wiki = shift;
39 wakaba 1.10
40     ## Installed plugin modules
41 wakaba 1.8 $wiki->{plugin}->load_directory (qw(
42     lib/SuikaWiki/Plugin/
43     misc/plugins/
44 wakaba 1.10 misc/plugins/form/
45 wakaba 1.9 misc/plugins/format/
46 wakaba 1.10 misc/plugins/link/
47 wakaba 1.8 misc/plugins/view/
48     ));
49 wakaba 1.10
50     ## Configuration file as pseudo-plugin module
51 wakaba 1.6 require 'wikidata/config.ph';
52     };
53    
54 wakaba 1.10 ## -- WikiDatabase: Mapping logical to physical
55 wakaba 1.6 push @{$WIKI->{event}->{database_loaded}}, sub {
56 wakaba 1.10 my $wiki = shift;
57    
58 wakaba 1.6 ## Main content
59 wakaba 1.10 $wiki->{db}->_set_prop_db (content => {-db_open => sub {
60 wakaba 1.6 require SuikaWiki::DB::FileSystem::YukiWikiDBNS;
61     SuikaWiki::DB::FileSystem::YukiWikiDBNS->new
62 wakaba 1.10 (directory => $wiki->{config}->{path_to}->{db__content__dir},
63     logfile => $wiki->{config}->{path_to}->{db__content__error_log},
64 wakaba 1.6 suffix => '.txt',
65 wakaba 1.10 -lock => $wiki->{var}->{db}->{lock_prop}->('content'));
66 wakaba 1.8 }, -db_close => sub {
67     my %opt = @_;
68     $opt{prop_info}->{-db}->close;
69     delete $opt{prop_info}->{-db};
70     }});
71 wakaba 1.6
72     ## Last modified
73 wakaba 1.10 $wiki->{db}->_set_prop_db (lastmodified => {-db_open => sub {
74 wakaba 1.6 require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09;
75     SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new
76 wakaba 1.10 (directory => $wiki->{config}->{path_to}->{db__content__dir},
77     -lock => $wiki->{var}->{db}->{lock_prop}->('lastmodified'));
78 wakaba 1.8 }, -prop => 'last_modified', -db_close => sub {
79     my %opt = @_;
80     $opt{prop_info}->{-db}->close;
81     delete $opt{prop_info}->{-db};
82     }});
83 wakaba 1.10
84     ## Cache
85     require SuikaWiki::DB::FileSystem::SuikaWikiCache09;
86     my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new
87     (directory => $wiki->{config}->{path_to}->{db__cache__dir});
88     $wiki->{db}->_set_prop_db (m__search_result =>
89     {-db => $cachedb, -prop => 'search_result', -db_close => sub {
90     my %opt = @_;
91     $opt{prop_info}->{-db}->close;
92     delete $opt{prop_info}->{-db};
93     }});
94     $wiki->{db}->_set_prop_db (wpp__headsummary =>
95     {-db => $cachedb, -prop => 'headsummary', -db_close => sub {
96     my %opt = @_;
97     $opt{prop_info}->{-db}->close;
98     delete $opt{prop_info}->{-db};
99     }});
100    
101     ## Additional WikiDB properties should be defined here
102     # ...
103 wakaba 1.6 };
104    
105 wakaba 1.10 ## -- WikiName of special purpose WikiPages
106 wakaba 1.8 $WIKI->{config}->{page} = {
107 wakaba 1.11 Default => $WIKI->name ([qw/HomePage/]),
108     InterWikiName => $WIKI->name ([qw/Wiki InterWikiName/]),
109     NewPageTemplate => $WIKI->name ([qw/Wiki NewPageTemplate/]),
110     'StyleSheetList(text/html)' => $WIKI->name ([qw<Wiki Style List text/html>]),
111 wakaba 1.8 };
112    
113 wakaba 1.10 ## -- WikiNamespace constants
114 wakaba 1.11 $WIKI->{config}->{name}->{space} = {
115     separator => '//',
116     separator_reg => qr#\s*//\s*#,
117     self => '.',
118     parent => '..',
119     };
120 wakaba 1.7
121 wakaba 1.10 ## -- Default character codes
122 wakaba 1.11 $WIKI->{config}->{charset} = {
123     ## Internal code - MUST be ASCII + 8bit coding scheme
124     internal => 'euc-jp',
125     ## Default output code
126     output => 'iso-2022-jp',
127     ## "query" part in URI reference
128     uri_query => '', # auto-detected
129     uri_query_encode => 'euc-jp', ## For compatibility w/ SuikaWiki 2
130     uri_param => '', # auto-detected
131     uri_param_encode => 'euc-jp', ## For compatibility w/ SuikaWiki 2
132     ## PATH_INFO part in URI reference
133     uri_path_info => 'x-utf-8-10646', ## Reserved for future use
134     ## Fragment identifier in URI reference
135     uri_fragment => 'x-punycode', ## Reserved for possible future use
136     };
137 wakaba 1.7
138 wakaba 1.10 ## -- Expires duration templates
139 wakaba 1.6 $WIKI->{config}->{entity}->{expires} = {
140 wakaba 1.7 edit => {delta => 60},
141     view => {delta => 2*3600},
142 wakaba 1.6 lm_flaged => {delta => 30*24*3600},
143 wakaba 1.11 stylesheet => {delta => 30*24*3600},
144     error => {delta => 60},
145     };
146    
147     ## -- Debug mode
148     $WIKI->{config}->{debug} = {
149     general => 1,
150     db => 0,
151     view => 1,
152 wakaba 1.6 };
153 wakaba 1.4
154 wakaba 1.10 }
155 wakaba 1.8
156 wakaba 1.10 =head1 SEE ALSO
157 w 1.3
158 wakaba 1.10 C<lib/suikawiki.pl>, C<wiki.cgi>,
159     <http://suika.fam.cx/~wakaba/-temp/wiki/wiki?SuikaWiki>,
160     <http://suika.fam.cx/~wakaba/-temp/wiki/wiki?SWHCS>
161 w 1.3
162     =head1 LICENSE
163    
164 wakaba 1.10 Copyright 2003-2004 Wakaba <w@suika.fam.cx>. All rights reserved.
165 w 1.3
166     This program is free software; you can redistribute it and/or
167     modify it under the same terms as Perl itself.
168    
169     =cut
170 w 1.1
171 wakaba 1.11 1; # $Date: 2004/02/01 12:34:18 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24