=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]; } ## -- 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 => $WIKI->name ([qw/HomePage/]), InterWikiName => $WIKI->name ([qw/Wiki InterWikiName/]), NewPageTemplate => $WIKI->name ([qw/Wiki NewPageTemplate/]), 'StyleSheetList(text/html)' => $WIKI->name ([qw]), }; ## -- WikiNamespace constants $WIKI->{config}->{name}->{space} = { separator => '//', separator_reg => qr#\s*//\s*#, self => '.', parent => '..', }; ## -- Default character codes $WIKI->{config}->{charset} = { ## Internal code - MUST be ASCII + 8bit coding scheme internal => 'euc-jp', ## Default output code output => 'iso-2022-jp', ## "query" part in URI reference uri_query => '', # auto-detected uri_query_encode => 'euc-jp', ## For compatibility w/ SuikaWiki 2 uri_param => '', # auto-detected uri_param_encode => 'euc-jp', ## For compatibility w/ SuikaWiki 2 ## PATH_INFO part in URI reference uri_path_info => 'x-utf-8-10646', ## Reserved for future use ## Fragment identifier in URI reference uri_fragment => 'x-punycode', ## Reserved for possible future use }; ## -- Expires duration templates $WIKI->{config}->{entity}->{expires} = { edit => {delta => 60}, view => {delta => 2*3600}, lm_flaged => {delta => 30*24*3600}, stylesheet => {delta => 30*24*3600}, error => {delta => 60}, }; ## -- Debug mode $WIKI->{config}->{debug} = { general => 1, db => 0, view => 1, }; } =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/08 09:01:57 $