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 |
|
## 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>, |
## Note: If your Wiki CGI 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 |
20 |
## Path to modules and databases |
## Path to modules and databases |
21 |
push @main::INC, qw'lib ../wiki/lib lib'; |
push @main::INC, qw'lib ../wiki/lib lib'; |
22 |
|
|
23 |
|
## Constructing a new instance of the WikiEngine |
24 |
require SuikaWiki::Implementation; |
require SuikaWiki::Implementation; |
25 |
our $WIKI = SuikaWiki::Implementation->new; |
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) |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from 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 |
40 |
$WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; |
$WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; |
41 |
} |
} |
42 |
|
|
43 |
## Plugin |
## WikiPlugin |
44 |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { |
45 |
## Obsolete interface |
## Obsolete interface |
46 |
push @SuikaWiki::Plugin::plugin_directory, ( |
push @SuikaWiki::Plugin::plugin_directory, ( |
47 |
q(../wiki/lib/SuikaWiki/Plugin/), |
# q(../wiki/lib/SuikaWiki/Plugin/), |
48 |
q(../wiki/misc/plugins/), |
# q(../wiki/misc/plugins/), |
49 |
q(lib/SuikaWiki/Plugin/), |
q(lib/SuikaWiki/Plugin/), |
50 |
q(misc/plugins/), |
q(misc/plugins/), |
51 |
); |
); |
52 |
SuikaWiki::Plugin->import_plugins (); |
SuikaWiki::Plugin->import_plugins (); |
53 |
|
|
54 |
|
## Plugin style new configuration file |
55 |
require 'wikidata/config.ph'; |
require 'wikidata/config.ph'; |
56 |
}; |
}; |
57 |
|
|
58 |
## Database mapping |
## WikiDatabase : Mapping of logical to physical |
59 |
push @{$WIKI->{event}->{database_loaded}}, sub { |
push @{$WIKI->{event}->{database_loaded}}, sub { |
60 |
## Main content |
## Main content |
61 |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
$WIKI->{db}->_set_prop_db (content => {-db_open => sub { |
74 |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
(directory => $WIKI->{config}->{path_to}->{db__content__dir}, |
75 |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
-lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); |
76 |
}, -prop => 'last_modified', -own => 1}); |
}, -prop => 'last_modified', -own => 1}); |
77 |
}; |
|
78 |
|
## OBSOLETE interface for transition |
|
push @{$WIKI->{event}->{database_loaded}}, sub { |
|
79 |
$WIKI->{db}->get (content => ['dummy']); |
$WIKI->{db}->get (content => ['dummy']); |
80 |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
*main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; |
81 |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
$SuikaWiki::Plugin::DB = $WIKI->{db}; |
87 |
sub STORE {}; |
sub STORE {}; |
88 |
}; |
}; |
89 |
|
|
90 |
|
## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations) |
|
## Name of Special WikiPage (linked as parts of navigations) |
|
91 |
our %PageName = ( |
our %PageName = ( |
92 |
FrontPage => 'HomePage', |
FrontPage => 'HomePage', |
93 |
IndexPage => 'IndexPage', |
IndexPage => 'IndexPage', |
103 |
UserAgentList => 'Wiki//UserAgentList', |
UserAgentList => 'Wiki//UserAgentList', |
104 |
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
105 |
); |
); |
106 |
|
|
107 |
|
## WikiName of special purpose WikiPages |
108 |
$WIKI->{config}->{page} = { |
$WIKI->{config}->{page} = { |
109 |
Default => [qw/HomePage/], |
Default => [qw/HomePage/], |
110 |
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
NewPageTemplate => [qw/Wiki NewPageTemplate/], |
111 |
}; |
}; |
112 |
our %PageOf = %{$WIKI->{config}->{page}}; |
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'; |
$WIKI->{config}->{charset}->{internal} = 'euc-jp'; |
120 |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
$WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; |
121 |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
$WIKI->{config}->{charset}->{uri_param} = ''; # auto detect |
122 |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
$WIKI->{config}->{charset}->{uri_query} = ''; # auto detect |
123 |
our $kanjicode = 'euc'; # obsolete |
|
124 |
|
## Expires duration templates |
125 |
$WIKI->{config}->{entity}->{expires} = { |
$WIKI->{config}->{entity}->{expires} = { |
126 |
edit => {delta => 60}, |
edit => {delta => 60}, |
127 |
view => {delta => 2*3600}, |
view => {delta => 2*3600}, |
128 |
lm_flaged => {delta => 30*24*3600}, |
lm_flaged => {delta => 30*24*3600}, |
129 |
}; |
}; |
130 |
|
|
|
## Misc. options |
|
|
$SuikaWiki::Plugin::UserAgent::LoggingName = 1; |
|
|
## Use UA-name log? (require UserAgent plugin module) |
|
|
|
|
|
## Definition of views |
|
|
|
|
|
require SuikaWiki::View; |
|
|
|
|
|
push @{$SuikaWiki::Plugin::On{Load}}, sub { |
|
|
SuikaWiki::View->definition ('read')->property (template => <<'EOH'); |
|
|
%html-document(title=>{%res(name=>{View:WebPageTitle});}p,link-meta=>{%predefined-template(name=>links);}p,content=>{ |
|
|
%section(level=>1,add-to-toc=>0,type=>body,title=>{%ns-short-page-name;}p,heading,content=>{ |
|
|
%section(id=>tools1,class=>tools,add-to-toc=>0,content=>{%predefined-template(name=>navbar);}p); |
|
|
%section(level=>2,id=>read,add-to-toc=>0,content=>{ |
|
|
%if-calender(month,true=>{ |
|
|
%format(context=>form_input,template=>{%calender;}); |
|
|
},false=>{ |
|
|
%if-calender(true=>{ |
|
|
%format(context=>form_input,template=>{%calender-months;}); |
|
|
}); |
|
|
}); |
|
|
%read(comment); |
|
|
}p); |
|
|
%section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading, |
|
|
content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{%res(name=>{Children:Item});}p);}p); |
|
|
%section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p); |
|
|
%section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p); |
|
|
%section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title});}p,heading,add_to_toc=>0,content=>{%toc(drag);}p); |
|
|
%section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p); |
|
|
%section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p); |
|
|
%section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p); |
|
|
}p); |
|
|
}p);%log-hotness; |
|
|
EOH |
|
|
SuikaWiki::View->definition ('wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);)); |
|
|
SuikaWiki::View->definition ('WithMenu')->property (template => SuikaWiki::View->definition ('WithMenu')->property ('template').q(%log-hotness;)); |
|
|
}; |
|
|
|
|
131 |
=head1 NAME |
=head1 NAME |
132 |
|
|
133 |
suikawiki-config.ph --- SuikaWiki: site configuration script |
suikawiki-config.ph --- SuikaWiki: Configuration of the wiki |
134 |
|
|
135 |
=head1 LICENSE |
=head1 LICENSE |
136 |
|
|