/[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.7 - (hide annotations) (download)
Thu Oct 30 07:48:44 2003 UTC (21 years ago) by wakaba
Branch: MAIN
Changes since 1.6: +26 -56 lines
Remove some obsolete configurations

1 wakaba 1.6 package main;
2 w 1.1 use strict;
3 wakaba 1.4
4 wakaba 1.7 ## [OBSOLETE] URI (or part of URI) of Wiki CGI itself and its external addons
5 wakaba 1.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 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.6 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 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.4 our %PathTo = ( ## Path to your data, from the main CGI script (NOT from 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.7 ## WikiPlugin
44 wakaba 1.6 push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {
45     ## Obsolete interface
46     push @SuikaWiki::Plugin::plugin_directory, (
47 wakaba 1.7 # q(../wiki/lib/SuikaWiki/Plugin/),
48     # q(../wiki/misc/plugins/),
49 wakaba 1.6 q(lib/SuikaWiki/Plugin/),
50     q(misc/plugins/),
51     );
52     SuikaWiki::Plugin->import_plugins ();
53 wakaba 1.7
54     ## Plugin style new configuration file
55 wakaba 1.6 require 'wikidata/config.ph';
56     };
57    
58 wakaba 1.7 ## WikiDatabase : Mapping of logical to physical
59 wakaba 1.6 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 wakaba 1.7
78     ## OBSOLETE interface for transition
79 wakaba 1.6 $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 wakaba 1.7 ## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations)
91 wakaba 1.4 our %PageName = (
92     FrontPage => 'HomePage',
93     IndexPage => 'IndexPage',
94 wakaba 1.6 InterWikiName => 'Wiki//InterWikiName',
95     SearchPage => 'Wiki//Page//Search',
96     CreatePage => 'Wiki//Page//Create',
97     MenuBar => 'Wiki//MenuBar',
98 wakaba 1.4 RecentChanges => 'RecentChanges',
99 wakaba 1.6 RefererDontRecord => 'Wiki//Referer//IgnoreSite',
100     RefererSiteName => 'Wiki//Referer//SiteName',
101     ResourceNS => 'Wiki//Resource//',
102     StyleList => 'Wiki//Style//List//',
103     UserAgentList => 'Wiki//UserAgentList',
104 wakaba 1.4 AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11",
105     );
106 wakaba 1.7
107     ## WikiName of special purpose WikiPages
108 wakaba 1.6 $WIKI->{config}->{page} = {
109     Default => [qw/HomePage/],
110     NewPageTemplate => [qw/Wiki NewPageTemplate/],
111     };
112     our %PageOf = %{$WIKI->{config}->{page}};
113 wakaba 1.7
114     ## WikiNamespace constants
115     $WIKI->{config}->{name}->{space}->{separator} = '//';
116     $WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#;
117    
118     ## Character code
119 wakaba 1.6 $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 wakaba 1.7
124     ## Expires duration templates
125 wakaba 1.6 $WIKI->{config}->{entity}->{expires} = {
126 wakaba 1.7 edit => {delta => 60},
127     view => {delta => 2*3600},
128 wakaba 1.6 lm_flaged => {delta => 30*24*3600},
129     };
130 wakaba 1.4
131 w 1.3 =head1 NAME
132    
133 wakaba 1.7 suikawiki-config.ph --- SuikaWiki: Configuration of the wiki
134 w 1.3
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 w 1.1
144 wakaba 1.7 1; # $Date: 2003/10/25 06:40:08 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24