1 |
package main; |
2 |
use strict; |
3 |
|
4 |
## [OBSOLETE] URI (or part of URI) of Wiki CGI itself and its external addons |
5 |
## Note: If your Wiki CGI 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 |
our $url_cgi = "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 |
$uri{wiki_abs} = $url_cgi; |
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, from the main CGI script (NOT from 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 |
## WikiPlugin |
44 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
45 |
## Obsolete interface |
46 |
push @SuikaWiki::Plugin::plugin_directory, ( |
47 |
# q(../wiki/lib/SuikaWiki/Plugin/), |
48 |
# q(../wiki/misc/plugins/), |
49 |
q(lib/SuikaWiki/Plugin/), |
50 |
q(misc/plugins/), |
51 |
); |
52 |
SuikaWiki::Plugin->import_plugins (); |
53 |
|
54 |
## Plugin style new configuration file |
55 |
require 'wikidata/config.ph'; |
56 |
}; |
57 |
|
58 |
## WikiDatabase : Mapping of logical to physical |
59 |
push @{$WIKI->{event}->{database_loaded}}, sub { |
60 |
## Main content |
61 |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
62 |
require SuikaWiki::DB::FileSystem::YukiWikiDBNS; |
63 |
SuikaWiki::DB::FileSystem::YukiWikiDBNS->new |
64 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
65 |
logfile => $WIKI->{config}->{path_to}->{db__content__error_log}, |
66 |
suffix => '.txt', |
67 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('content')); |
68 |
}, -own => 1}); |
69 |
|
70 |
## Last modified |
71 |
$WIKI->{db}->_set_prop_db (lastmodified => {-db_open => sub { |
72 |
require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09; |
73 |
SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new |
74 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
75 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
76 |
}, -prop => 'last_modified', -own => 1}); |
77 |
|
78 |
## OBSOLETE interface for transition |
79 |
$WIKI->{db}->get (content => ['dummy']); |
80 |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
81 |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
82 |
for (@{$SuikaWiki::Plugin::On{WikiDatabaseLoaded}||[]}) { &{$_} } |
83 |
|
84 |
package wiki::dummy; |
85 |
sub meta {undef}; |
86 |
sub list_items {}; |
87 |
sub STORE {}; |
88 |
}; |
89 |
|
90 |
## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations) |
91 |
our %PageName = ( |
92 |
FrontPage => 'HomePage', |
93 |
IndexPage => 'IndexPage', |
94 |
InterWikiName => 'Wiki//InterWikiName', |
95 |
SearchPage => 'Wiki//Page//Search', |
96 |
CreatePage => 'Wiki//Page//Create', |
97 |
MenuBar => 'Wiki//MenuBar', |
98 |
RecentChanges => 'RecentChanges', |
99 |
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
100 |
RefererSiteName => 'Wiki//Referer//SiteName', |
101 |
ResourceNS => 'Wiki//Resource//', |
102 |
StyleList => 'Wiki//Style//List//', |
103 |
UserAgentList => 'Wiki//UserAgentList', |
104 |
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
105 |
); |
106 |
|
107 |
## WikiName of special purpose WikiPages |
108 |
$WIKI->{config}->{page} = { |
109 |
Default => [qw/HomePage/], |
110 |
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
111 |
}; |
112 |
our %PageOf = %{$WIKI->{config}->{page}}; |
113 |
|
114 |
## WikiNamespace constants |
115 |
$WIKI->{config}->{name}->{space}->{separator} = '//'; |
116 |
$WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; |
117 |
|
118 |
## Character code |
119 |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
120 |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
121 |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
122 |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
123 |
|
124 |
## Expires duration templates |
125 |
$WIKI->{config}->{entity}->{expires} = { |
126 |
edit => {delta => 60}, |
127 |
view => {delta => 2*3600}, |
128 |
lm_flaged => {delta => 30*24*3600}, |
129 |
}; |
130 |
|
131 |
=head1 NAME |
132 |
|
133 |
suikawiki-config.ph --- SuikaWiki: Configuration of the wiki |
134 |
|
135 |
=head1 LICENSE |
136 |
|
137 |
Copyright 2003 Wakaba <w@suika.fam.cx> |
138 |
|
139 |
This program is free software; you can redistribute it and/or |
140 |
modify it under the same terms as Perl itself. |
141 |
|
142 |
=cut |
143 |
|
144 |
1; # $Date: 2003/10/25 06:40:08 $ |