10 |
external_script => '../wiki/script/', |
external_script => '../wiki/script/', |
11 |
script_short_name => 'wiki', |
script_short_name => 'wiki', |
12 |
## If you use CVS repository of WikiDatabase, |
## If you use CVS repository of WikiDatabase, |
13 |
#cvs_repository => 'http://path-to-viewcvs/path-to-repository/', |
cvs_repository => '/gate/cvs/suikawiki/wikidata/page/', |
14 |
); |
); |
15 |
our $url_cgi; { |
our $url_cgi; { |
16 |
my $scheme = 'http'; |
my $scheme = 'http'; |
17 |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
18 |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}".($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}")."$uri{cookie_path}$uri{script_short_name}"; |
$url_cgi = "$scheme://".($main::ENV{HTTP_HOST} || $main::ENV{SERVER_NAME}.($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}"))."$uri{cookie_path}$uri{script_short_name}"; |
19 |
} |
} |
20 |
$uri{wiki_abs} = $url_cgi; |
$uri{wiki_abs} = $url_cgi; |
21 |
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
27 |
q(misc/plugins/), |
q(misc/plugins/), |
28 |
); |
); |
29 |
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) |
30 |
CachePrefix => q(./wikidata/.cache.), |
CachePrefix => q(./wikidata/.cache.), |
31 |
TempPrefix => q(./wikidata/.tmp.), |
TempPrefix => q(./wikidata/.tmp.), |
32 |
WikiDataBase => q(./wikidata/page), |
WikiDataBase => q(./wikidata/page), |
33 |
WikiDatabaseErrorLog => q(./wikidata/error.log), |
WikiDatabase => q(./wikidata/page), |
34 |
convert => q(/usr/X11R6/bin/convert), |
WikiDatabaseErrorLog => q(./wikidata/log/error.log), |
35 |
|
convert => q(/usr/X11R6/bin/convert), |
36 |
); |
); |
37 |
|
|
38 |
|
require SuikaWiki::DB::Util::Lock; |
39 |
|
our $locker = SuikaWiki::DB::Util::Lock->new (-directory => q(./wikidata/lock), |
40 |
|
-name => 'wikipage', |
41 |
|
-retry => ($main::ENV{HTTP_USER_AGENT} =~ m#Openbot/3# ? 2 : 120), |
42 |
|
-error_handler => sub { |
43 |
|
my ($self, %o) = @_; |
44 |
|
open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog}; |
45 |
|
print LOG scalar (gmtime)."\@@{[time]} @{[$$]} {$o{level}}: ", $o{msg}, "\n"; |
46 |
|
close LOG; |
47 |
|
if ($o{level} eq 'fatal') { |
48 |
|
die $o{msg}; |
49 |
|
} |
50 |
|
}); |
51 |
|
$locker->lock or do { |
52 |
|
open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog}; |
53 |
|
print LOG scalar (time), " Can't lock\n"; |
54 |
|
close LOG; |
55 |
|
die "Can't lock"; |
56 |
|
}; |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
## Type of WikiPage Database |
## Type of WikiPage Database |
61 |
#our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. |
#our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. |
62 |
#our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. |
#our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. |
99 |
%link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p); |
%link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p); |
100 |
EOH |
EOH |
101 |
SuikaWiki::View->template ('navbar')->add_line (<<"EOH"); |
SuikaWiki::View->template ('navbar')->add_line (<<"EOH"); |
102 |
%anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E); |
%anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E,add-param=>{#edit}); |
103 |
%anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage);"p,title=>"%res(name=>ViewThisPageLong);"p); |
%anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage);"p,title=>"%res(name=>ViewThisPageLong);"p); |
104 |
%anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p); |
%anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p); |
105 |
%anchor-wiki(page=>{$main::PageName{IndexPage}},class=>wiki,label=>"%res(name=>GoToIndexPage);"p,title=>"%res(name=>GoToIndexPageLong);"p); |
%anchor-wiki(page=>{$main::PageName{IndexPage}},class=>wiki,label=>"%res(name=>GoToIndexPage);"p,title=>"%res(name=>GoToIndexPageLong);"p); |