/[pub]/suikawiki/script/default/suikawiki-config.ph
Suika

Contents of /suikawiki/script/default/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Fri Dec 26 07:05:09 2003 UTC (20 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.7: +41 -33 lines
*** empty log message ***

1 wakaba 1.6 package main;
2 w 1.1 use strict;
3 wakaba 1.4
4 wakaba 1.8 ## [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 wakaba 1.5 ## cookie-path: /path/to/
7     ## script-short-name: wiki.cgi
8     ## URI parts MUST NOT contains "&" and/or non-URI characters.
9 wakaba 1.4 our %uri = (
10 wakaba 1.6 cookie_path => '/~wakaba/-temp/expwiki/',
11     external_script => '../wiki/script/',
12 wakaba 1.5 script_short_name => 'wiki',
13 wakaba 1.6 ## If you use CVS repository of WikiDatabase,
14     #cvs_repository => 'http://path-to-viewcvs/path-to-repository/',
15 wakaba 1.4 );
16 wakaba 1.8 $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 wakaba 1.6 $uri{wiki} = qq($uri{cookie_path}$uri{script_short_name});
19 wakaba 1.4
20     ## Path to modules and databases
21 wakaba 1.6 push @main::INC, qw'lib ../wiki/lib lib';
22    
23 wakaba 1.7 ## Constructing a new instance of the WikiEngine
24 wakaba 1.6 require SuikaWiki::Implementation;
25     our $WIKI = SuikaWiki::Implementation->new;
26    
27 wakaba 1.7 ## Obsolete interface
28 wakaba 1.8 our %PathTo = ( ## Path to your data, relative to the main CGI script (NOT to this config script)
29 wakaba 1.6 CachePrefix => q(./wikidata/.cache.), # WikiPlugin
30     TempPrefix => q(./wikidata/.tmp.), # WikiPlugin, Image
31     convert => q(/usr/X11R6/bin/convert), # Image
32 wakaba 1.4 );
33    
34 wakaba 1.6 ## 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 wakaba 1.8 ## Debug mode
44     $WIKI->{config}->{debug} = {
45     general => 1,
46     db => 0,
47     };
48    
49 wakaba 1.7 ## WikiPlugin
50 wakaba 1.6 push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {
51 wakaba 1.8 my $wiki = shift;
52     $wiki->{plugin}->load_directory (qw(
53     lib/SuikaWiki/Plugin/
54     misc/plugins/
55     misc/plugins/view/
56     ));
57 wakaba 1.6 require 'wikidata/config.ph';
58     };
59    
60 wakaba 1.8 ## WikiDatabase : Mapping logical to physical
61 wakaba 1.6 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 wakaba 1.8 }, -db_close => sub {
71     my %opt = @_;
72     $opt{prop_info}->{-db}->close;
73     delete $opt{prop_info}->{-db};
74     }});
75 wakaba 1.6
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 wakaba 1.8 }, -prop => 'last_modified', -db_close => sub {
83     my %opt = @_;
84     $opt{prop_info}->{-db}->close;
85     delete $opt{prop_info}->{-db};
86     }});
87 wakaba 1.7
88     ## OBSOLETE interface for transition
89 wakaba 1.8 ## Don't remove until WikiResource is reimplemented
90 wakaba 1.6 $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 wakaba 1.8 ## WikiName of special purpose WikiPages
102     $WIKI->{config}->{page} = {
103     Default => [qw/HomePage/],
104     NewPageTemplate => [qw/Wiki NewPageTemplate/],
105     };
106    
107 wakaba 1.7 ## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations)
108 wakaba 1.4 our %PageName = (
109     FrontPage => 'HomePage',
110 wakaba 1.6 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 wakaba 1.4 );
117 wakaba 1.7
118     ## WikiNamespace constants
119     $WIKI->{config}->{name}->{space}->{separator} = '//';
120     $WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#;
121    
122 wakaba 1.8 ## Default character code
123 wakaba 1.6 $WIKI->{config}->{charset}->{internal} = 'euc-jp';
124     $WIKI->{config}->{charset}->{output} = 'iso-2022-jp';
125     $WIKI->{config}->{charset}->{uri_param} = ''; # auto detect
126 wakaba 1.8 $WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp';
127 wakaba 1.6 $WIKI->{config}->{charset}->{uri_query} = ''; # auto detect
128 wakaba 1.8 $WIKI->{config}->{charset}->{uri_query_encode} = 'euc-jp';
129     $WIKI->{config}->{charset}->{uri_path_info} = 'utf-8';
130 wakaba 1.7
131     ## Expires duration templates
132 wakaba 1.6 $WIKI->{config}->{entity}->{expires} = {
133 wakaba 1.7 edit => {delta => 60},
134     view => {delta => 2*3600},
135 wakaba 1.6 lm_flaged => {delta => 30*24*3600},
136     };
137 wakaba 1.4
138 wakaba 1.8
139 w 1.3 =head1 NAME
140    
141 wakaba 1.7 suikawiki-config.ph --- SuikaWiki: Configuration of the wiki
142 w 1.3
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 w 1.1
152 wakaba 1.8 1; # $Date: 2003/10/30 07:48:44 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24