1 |
package main; |
2 |
use strict; |
3 |
|
4 |
## [OBSOLETE] URI (or part of URI) of Wiki CGI script itself and its external addons |
5 |
## Note: If your Wiki CGI script URI is <http://foo.example/path/to/wiki.cgi>, |
6 |
## cookie-path: /path/to/ |
7 |
## script-short-name: wiki.cgi |
8 |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
9 |
our %uri = ( |
10 |
cookie_path => '/~wakaba/-temp/expwiki/', |
11 |
external_script => '../wiki/script/', |
12 |
script_short_name => 'wiki', |
13 |
## If you use CVS repository of WikiDatabase, |
14 |
#cvs_repository => 'http://path-to-viewcvs/path-to-repository/', |
15 |
); |
16 |
$uri{wiki_abs} = "http://".($main::ENV{HTTP_HOST} || $main::ENV{SERVER_NAME}.($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}"))."$uri{cookie_path}$uri{script_short_name}"; |
17 |
$main::url_cgi = $uri{wiki_abs}; |
18 |
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
19 |
|
20 |
## Path to modules and databases |
21 |
push @main::INC, qw'lib ../wiki/lib lib'; |
22 |
|
23 |
## Constructing a new instance of the WikiEngine |
24 |
require SuikaWiki::Implementation; |
25 |
our $WIKI = SuikaWiki::Implementation->new; |
26 |
|
27 |
## Obsolete interface |
28 |
our %PathTo = ( ## Path to your data, relative to the main CGI script (NOT to this config script) |
29 |
CachePrefix => q(./wikidata/.cache.), # WikiPlugin |
30 |
TempPrefix => q(./wikidata/.tmp.), # WikiPlugin, Image |
31 |
convert => q(/usr/X11R6/bin/convert), # Image |
32 |
); |
33 |
|
34 |
## Filesystem path mapping |
35 |
for ( |
36 |
[db__content__dir => q"./wikidata/page"], |
37 |
[db__content__error_log => q"./wikidata/log/db-content.log"], |
38 |
[db__lock__dir => q"./wikidata/lock/"], |
39 |
) { |
40 |
$WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; |
41 |
} |
42 |
|
43 |
## Debug mode |
44 |
$WIKI->{config}->{debug} = { |
45 |
general => 1, |
46 |
db => 0, |
47 |
}; |
48 |
|
49 |
## WikiPlugin |
50 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
51 |
my $wiki = shift; |
52 |
$wiki->{plugin}->load_directory (qw( |
53 |
lib/SuikaWiki/Plugin/ |
54 |
misc/plugins/ |
55 |
misc/plugins/view/ |
56 |
)); |
57 |
require 'wikidata/config.ph'; |
58 |
}; |
59 |
|
60 |
## WikiDatabase : Mapping logical to physical |
61 |
push @{$WIKI->{event}->{database_loaded}}, sub { |
62 |
## Main content |
63 |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
64 |
require SuikaWiki::DB::FileSystem::YukiWikiDBNS; |
65 |
SuikaWiki::DB::FileSystem::YukiWikiDBNS->new |
66 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
67 |
logfile => $WIKI->{config}->{path_to}->{db__content__error_log}, |
68 |
suffix => '.txt', |
69 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('content')); |
70 |
}, -db_close => sub { |
71 |
my %opt = @_; |
72 |
$opt{prop_info}->{-db}->close; |
73 |
delete $opt{prop_info}->{-db}; |
74 |
}}); |
75 |
|
76 |
## Last modified |
77 |
$WIKI->{db}->_set_prop_db (lastmodified => {-db_open => sub { |
78 |
require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09; |
79 |
SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new |
80 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
81 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
82 |
}, -prop => 'last_modified', -db_close => sub { |
83 |
my %opt = @_; |
84 |
$opt{prop_info}->{-db}->close; |
85 |
delete $opt{prop_info}->{-db}; |
86 |
}}); |
87 |
|
88 |
## OBSOLETE interface for transition |
89 |
## Don't remove until WikiResource is reimplemented |
90 |
$WIKI->{db}->get (content => ['dummy']); |
91 |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
92 |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
93 |
for (@{$SuikaWiki::Plugin::On{WikiDatabaseLoaded}||[]}) { &{$_} } |
94 |
|
95 |
package wiki::dummy; |
96 |
sub meta {undef}; |
97 |
sub list_items {}; |
98 |
sub STORE {}; |
99 |
}; |
100 |
|
101 |
## WikiName of special purpose WikiPages |
102 |
$WIKI->{config}->{page} = { |
103 |
Default => [qw/HomePage/], |
104 |
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
105 |
}; |
106 |
|
107 |
## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations) |
108 |
our %PageName = ( |
109 |
FrontPage => 'HomePage', |
110 |
InterWikiName => 'Wiki//InterWikiName', |
111 |
MenuBar => 'Wiki//MenuBar', |
112 |
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
113 |
RefererSiteName => 'Wiki//Referer//SiteName', |
114 |
ResourceNS => 'Wiki//Resource//', |
115 |
StyleList => 'Wiki//Style//List//', |
116 |
); |
117 |
|
118 |
## WikiNamespace constants |
119 |
$WIKI->{config}->{name}->{space}->{separator} = '//'; |
120 |
$WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; |
121 |
|
122 |
## Default character code |
123 |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
124 |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
125 |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
126 |
$WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp'; |
127 |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
128 |
$WIKI->{config}->{charset}->{uri_query_encode} = 'euc-jp'; |
129 |
$WIKI->{config}->{charset}->{uri_path_info} = 'utf-8'; |
130 |
|
131 |
## Expires duration templates |
132 |
$WIKI->{config}->{entity}->{expires} = { |
133 |
edit => {delta => 60}, |
134 |
view => {delta => 2*3600}, |
135 |
lm_flaged => {delta => 30*24*3600}, |
136 |
}; |
137 |
|
138 |
|
139 |
=head1 NAME |
140 |
|
141 |
suikawiki-config.ph --- SuikaWiki: Configuration of the wiki |
142 |
|
143 |
=head1 LICENSE |
144 |
|
145 |
Copyright 2003 Wakaba <w@suika.fam.cx> |
146 |
|
147 |
This program is free software; you can redistribute it and/or |
148 |
modify it under the same terms as Perl itself. |
149 |
|
150 |
=cut |
151 |
|
152 |
1; # $Date: 2003/10/30 07:48:44 $ |