1 |
package main; |
package main; |
2 |
use strict; |
use strict; |
3 |
|
|
4 |
## [OBSOLETE] URI (or part of URI) of Wiki CGI itself and its external addons |
## [OBSOLETE] URI (or part of URI) of Wiki CGI script itself and its external addons |
5 |
## Note: If your Wiki CGI URI is <http://foo.example/path/to/wiki.cgi>, |
## Note: If your Wiki CGI script URI is <http://foo.example/path/to/wiki.cgi>, |
6 |
## cookie-path: /path/to/ |
## cookie-path: /path/to/ |
7 |
## script-short-name: wiki.cgi |
## script-short-name: wiki.cgi |
8 |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
13 |
## If you use CVS repository of WikiDatabase, |
## If you use CVS repository of WikiDatabase, |
14 |
#cvs_repository => 'http://path-to-viewcvs/path-to-repository/', |
#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}"; |
$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 |
$uri{wiki_abs} = $url_cgi; |
$main::url_cgi = $uri{wiki_abs}; |
18 |
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
19 |
|
|
20 |
## Path to modules and databases |
## Path to modules and databases |
25 |
our $WIKI = SuikaWiki::Implementation->new; |
our $WIKI = SuikaWiki::Implementation->new; |
26 |
|
|
27 |
## Obsolete interface |
## Obsolete interface |
28 |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
our %PathTo = ( ## Path to your data, relative to the main CGI script (NOT to this config script) |
29 |
CachePrefix => q(./wikidata/.cache.), # WikiPlugin |
CachePrefix => q(./wikidata/.cache.), # WikiPlugin |
30 |
TempPrefix => q(./wikidata/.tmp.), # WikiPlugin, Image |
TempPrefix => q(./wikidata/.tmp.), # WikiPlugin, Image |
31 |
convert => q(/usr/X11R6/bin/convert), # Image |
convert => q(/usr/X11R6/bin/convert), # Image |
40 |
$WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; |
$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 |
## WikiPlugin |
50 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
51 |
## Obsolete interface |
my $wiki = shift; |
52 |
push @SuikaWiki::Plugin::plugin_directory, ( |
$wiki->{plugin}->load_directory (qw( |
53 |
# q(../wiki/lib/SuikaWiki/Plugin/), |
lib/SuikaWiki/Plugin/ |
54 |
# q(../wiki/misc/plugins/), |
misc/plugins/ |
55 |
q(lib/SuikaWiki/Plugin/), |
misc/plugins/view/ |
56 |
q(misc/plugins/), |
)); |
|
); |
|
|
SuikaWiki::Plugin->import_plugins (); |
|
|
|
|
|
## Plugin style new configuration file |
|
57 |
require 'wikidata/config.ph'; |
require 'wikidata/config.ph'; |
58 |
}; |
}; |
59 |
|
|
60 |
## WikiDatabase : Mapping of logical to physical |
## WikiDatabase : Mapping logical to physical |
61 |
push @{$WIKI->{event}->{database_loaded}}, sub { |
push @{$WIKI->{event}->{database_loaded}}, sub { |
62 |
## Main content |
## Main content |
63 |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
67 |
logfile => $WIKI->{config}->{path_to}->{db__content__error_log}, |
logfile => $WIKI->{config}->{path_to}->{db__content__error_log}, |
68 |
suffix => '.txt', |
suffix => '.txt', |
69 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('content')); |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('content')); |
70 |
}, -own => 1}); |
}, -db_close => sub { |
71 |
|
my %opt = @_; |
72 |
|
$opt{prop_info}->{-db}->close; |
73 |
|
delete $opt{prop_info}->{-db}; |
74 |
|
}}); |
75 |
|
|
76 |
## Last modified |
## Last modified |
77 |
$WIKI->{db}->_set_prop_db (lastmodified => {-db_open => sub { |
$WIKI->{db}->_set_prop_db (lastmodified => {-db_open => sub { |
79 |
SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new |
SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new |
80 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
81 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
82 |
}, -prop => 'last_modified', -own => 1}); |
}, -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 |
## OBSOLETE interface for transition |
89 |
|
## Don't remove until WikiResource is reimplemented |
90 |
$WIKI->{db}->get (content => ['dummy']); |
$WIKI->{db}->get (content => ['dummy']); |
91 |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
92 |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
98 |
sub STORE {}; |
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) |
## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations) |
108 |
our %PageName = ( |
our %PageName = ( |
109 |
FrontPage => 'HomePage', |
FrontPage => 'HomePage', |
|
IndexPage => 'IndexPage', |
|
110 |
InterWikiName => 'Wiki//InterWikiName', |
InterWikiName => 'Wiki//InterWikiName', |
|
SearchPage => 'Wiki//Page//Search', |
|
|
CreatePage => 'Wiki//Page//Create', |
|
111 |
MenuBar => 'Wiki//MenuBar', |
MenuBar => 'Wiki//MenuBar', |
|
RecentChanges => 'RecentChanges', |
|
112 |
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
113 |
RefererSiteName => 'Wiki//Referer//SiteName', |
RefererSiteName => 'Wiki//Referer//SiteName', |
114 |
ResourceNS => 'Wiki//Resource//', |
ResourceNS => 'Wiki//Resource//', |
115 |
StyleList => 'Wiki//Style//List//', |
StyleList => 'Wiki//Style//List//', |
|
UserAgentList => 'Wiki//UserAgentList', |
|
|
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
|
116 |
); |
); |
117 |
|
|
|
## WikiName of special purpose WikiPages |
|
|
$WIKI->{config}->{page} = { |
|
|
Default => [qw/HomePage/], |
|
|
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
|
|
}; |
|
|
our %PageOf = %{$WIKI->{config}->{page}}; |
|
|
|
|
118 |
## WikiNamespace constants |
## WikiNamespace constants |
119 |
$WIKI->{config}->{name}->{space}->{separator} = '//'; |
$WIKI->{config}->{name}->{space}->{separator} = '//'; |
120 |
$WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; |
$WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; |
121 |
|
|
122 |
## Character code |
## Default character code |
123 |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
124 |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
125 |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
126 |
|
$WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp'; |
127 |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
$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 |
## Expires duration templates |
132 |
$WIKI->{config}->{entity}->{expires} = { |
$WIKI->{config}->{entity}->{expires} = { |
135 |
lm_flaged => {delta => 30*24*3600}, |
lm_flaged => {delta => 30*24*3600}, |
136 |
}; |
}; |
137 |
|
|
138 |
|
|
139 |
=head1 NAME |
=head1 NAME |
140 |
|
|
141 |
suikawiki-config.ph --- SuikaWiki: Configuration of the wiki |
suikawiki-config.ph --- SuikaWiki: Configuration of the wiki |