package main; use strict; ## [OBSOLETE] URI (or part of URI) of Wiki CGI script itself and its external addons ## Note: If your Wiki CGI script URI is , ## cookie-path: /path/to/ ## script-short-name: wiki.cgi ## URI parts MUST NOT contains "&" and/or non-URI characters. our %uri = ( cookie_path => '/~wakaba/-temp/expwiki/', external_script => '../wiki/script/', script_short_name => 'wiki', ## If you use CVS repository of WikiDatabase, #cvs_repository => 'http://path-to-viewcvs/path-to-repository/', ); $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}"; $main::url_cgi = $uri{wiki_abs}; $uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); ## Path to modules and databases push @main::INC, qw'lib ../wiki/lib lib'; ## These lines should be removed after utf8 support $Message::Util::Formatter::Base::Token = qr/[\w._+\x80-\xFF-]+/; require Message::Util::Formatter::Base; ## Constructing a new instance of the WikiEngine require SuikaWiki::Implementation; our $WIKI = SuikaWiki::Implementation->new; ## Obsolete interface our %PathTo = ( ## Path to your data, relative to the main CGI script (NOT to this config script) CachePrefix => q(./wikidata/.cache.), # WikiPlugin TempPrefix => q(./wikidata/.tmp.), # WikiPlugin, Image convert => q(/usr/X11R6/bin/convert), # Image ); ## Filesystem path mapping for ( [db__content__dir => q"./wikidata/page"], [db__content__error_log => q"./wikidata/log/db-content.log"], [db__lock__dir => q"./wikidata/lock/"], ) { $WIKI->{config}->{path_to}->{$_->[0]} = $_->[1]; } ## Debug mode $WIKI->{config}->{debug} = { general => 1, db => 0, view => 1, }; ## WikiPlugin push @{$WIKI->{event}->{plugin_manager_loaded}}, sub { my $wiki = shift; $wiki->{plugin}->load_directory (qw( lib/SuikaWiki/Plugin/ misc/plugins/ misc/plugins/format/ misc/plugins/view/ )); require 'wikidata/config.ph'; }; ## WikiDatabase : Mapping logical to physical push @{$WIKI->{event}->{database_loaded}}, sub { ## Main content $WIKI->{db}->_set_prop_db (content => {-db_open => sub { require SuikaWiki::DB::FileSystem::YukiWikiDBNS; SuikaWiki::DB::FileSystem::YukiWikiDBNS->new (directory => $WIKI->{config}->{path_to}->{db__content__dir}, logfile => $WIKI->{config}->{path_to}->{db__content__error_log}, suffix => '.txt', -lock => &{$WIKI->{var}->{db}->{lock_prop}} ('content')); }, -db_close => sub { my %opt = @_; $opt{prop_info}->{-db}->close; delete $opt{prop_info}->{-db}; }}); ## Last modified $WIKI->{db}->_set_prop_db (lastmodified => {-db_open => sub { require SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09; SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09->new (directory => $WIKI->{config}->{path_to}->{db__content__dir}, -lock => &{$WIKI->{var}->{db}->{lock_prop}} ('lastmodified')); }, -prop => 'last_modified', -db_close => sub { my %opt = @_; $opt{prop_info}->{-db}->close; delete $opt{prop_info}->{-db}; }}); ## OBSOLETE interface for transition ## Don't remove until WikiResource is reimplemented $WIKI->{db}->get (content => ['dummy']); *main::database = $WIKI->{db}->{prop}->{content}->{-db}->{db_hash}; $SuikaWiki::Plugin::DB = $WIKI->{db}; for (@{$SuikaWiki::Plugin::On{WikiDatabaseLoaded}||[]}) { &{$_} } package wiki::dummy; sub meta {undef}; sub list_items {}; sub STORE {}; }; ## WikiName of special purpose WikiPages $WIKI->{config}->{page} = { Default => [qw/HomePage/], NewPageTemplate => [qw/Wiki NewPageTemplate/], }; ## [OBSOLETE] Name of Special WikiPage (linked as parts of navigations) our %PageName = ( FrontPage => 'HomePage', InterWikiName => 'Wiki//InterWikiName', MenuBar => 'Wiki//MenuBar', RefererDontRecord => 'Wiki//Referer//IgnoreSite', RefererSiteName => 'Wiki//Referer//SiteName', ResourceNS => 'Wiki//Resource//', StyleList => 'Wiki//Style//List//', ); ## WikiNamespace constants $WIKI->{config}->{name}->{space}->{separator} = '//'; $WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; ## Default character code $WIKI->{config}->{charset}->{internal} = 'euc-jp'; $WIKI->{config}->{charset}->{output} = 'iso-2022-jp'; $WIKI->{config}->{charset}->{uri_param} = ''; # auto detect $WIKI->{config}->{charset}->{uri_param_encode} = 'euc-jp'; $WIKI->{config}->{charset}->{uri_query} = ''; # auto detect $WIKI->{config}->{charset}->{uri_query_encode} = 'euc-jp'; $WIKI->{config}->{charset}->{uri_path_info} = 'utf-8'; ## Expires duration templates $WIKI->{config}->{entity}->{expires} = { edit => {delta => 60}, view => {delta => 2*3600}, lm_flaged => {delta => 30*24*3600}, }; =head1 NAME suikawiki-config.ph --- SuikaWiki: Configuration of the wiki =head1 LICENSE Copyright 2003 Wakaba This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # $Date: 2004/01/16 08:06:53 $