=head1 NAME suikawiki-config.ph - SuikaWiki: Configuration for SuikaWiki HTTP CGI Driver =head1 DESCRIPTION This is a configuration file for SuikaWiki Driver for HTTP CGI Script (SWHCS). Basic options such as WikiDB directory mapping and special purpose WikiPage names can be customized with this file. More complex customizing, e.g. modifying navigation bar or adding new mode, is also possible by config.ph (generated from config.wp2) and WikiPlugin modules. For more information, see . This file is part of SuikaWiki. =cut package wiki::driver::http; use strict; sub config ($) { my $WIKI = shift; ## -- Filesystem path mapping for ( [db__cache__dir => q"./wikidata/lock/"], [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; ## Installed plugin modules $wiki->{plugin}->load_directory (qw( lib/SuikaWiki/Plugin/ misc/plugins/ misc/plugins/form/ misc/plugins/format/ misc/plugins/link/ misc/plugins/view/ )); ## Configuration file as pseudo-plugin module require 'wikidata/config.ph'; }; ## -- WikiDatabase: Mapping logical to physical push @{$WIKI->{event}->{database_loaded}}, sub { my $wiki = shift; ## 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}; }}); ## Cache require SuikaWiki::DB::FileSystem::SuikaWikiCache09; my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new (directory => $wiki->{config}->{path_to}->{db__cache__dir}); $wiki->{db}->_set_prop_db (m__search_result => {-db => $cachedb, -prop => 'search_result', -db_close => sub { my %opt = @_; $opt{prop_info}->{-db}->close; delete $opt{prop_info}->{-db}; }}); $wiki->{db}->_set_prop_db (wpp__headsummary => {-db => $cachedb, -prop => 'headsummary', -db_close => sub { my %opt = @_; $opt{prop_info}->{-db}->close; delete $opt{prop_info}->{-db}; }}); ## Additional WikiDB properties should be defined here # ... }; ## -- WikiName of special purpose WikiPages $WIKI->{config}->{page} = { Default => [qw/HomePage/], InterWikiName => [qw/Wiki InterWikiName/], NewPageTemplate => [qw/Wiki NewPageTemplate/], }; ## -- WikiNamespace constants $WIKI->{config}->{name}->{space}->{separator} = '//'; $WIKI->{config}->{name}->{space}->{separator_reg} = qr#//#; ## -- Default character codes $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 SEE ALSO C, C, , =head1 LICENSE Copyright 2003-2004 Wakaba . All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # $Date: 2004/02/01 12:34:18 $