/[pub]/suikawiki/wikidata/suikawiki-config.ph
Suika

Diff of /suikawiki/wikidata/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.4.4 by wakaba, Sat Mar 13 13:16:59 2004 UTC revision 1.12.4.5 by wakaba, Sat Mar 20 04:09:14 2004 UTC
# Line 20  This file is part of SuikaWiki. Line 20  This file is part of SuikaWiki.
20  package wiki::driver::http;  package wiki::driver::http;
21  use strict;  use strict;
22    
   ## These lines should be removed after utf8 support  
   BEGIN {  
     $Message::Util::Formatter::Base::Token = qr/[\w._+\x80-\xFF-]+/;  
     require Message::Util::Formatter::Base;  
   }  
   
 use Message::Util::Error;  
23  push our @Config, sub ($) {  push our @Config, sub ($) {
24      eval { use Message::Util::Error };
25    my $WIKI = shift;    my $WIKI = shift;
26    use Cwd qw(abs_path);    use Cwd qw(abs_path);
27        
# Line 45  push our @Config, sub ($) { Line 39  push our @Config, sub ($) {
39       [db__lock__log_file      => q"./wikidata/log/lock.log"],       [db__lock__log_file      => q"./wikidata/log/lock.log"],
40       [db__log__dir            => q"./wikidata/log/"],       [db__log__dir            => q"./wikidata/log/"],
41       [db__temp__dir           => q"./wikidata/lock/"],       [db__temp__dir           => q"./wikidata/lock/"],
42         [namazu__index_dir       => q"/var/namazu/index/wakaba"],
43    ) {    ) {
44      ## On system that does not set current directory as main script      ## On system that does not set current directory as main script
45      ## directory, you should specify it instead of using "abs_path".      ## directory, you should specify it instead of using "abs_path".
46      $WIKI->{config}->{path_to}->{$_->[0]} = abs_path $_->[1];      $WIKI->{config}->{path_to}->{$_->[0]} = abs_path $_->[1];
47    }    }
48      
49      ## -- Namazu URI Mapping (See SuikaWiki:SuikaWiki//Namazu) --
50      $WIKI->{config}->{nmz__uri_to_uri} = sub {
51        my ($nmzuri, %opt) = @_;
52        if ($nmzuri =~ s!^\Q$opt{o}->{wiki}->{config}->{path_to}->{db__content__dir}\E/*!!o) {
53          $nmzuri =~ s/\.txt$//;
54          return $opt{o}->{wiki}->uri_reference
55                          (page => $opt{o}->{wiki}->name ([
56            map {s/([0-9A-F][0-9A-F])/pack 'C', hex $1/ge; $_}
57            split m!\.ns/!, $nmzuri
58          ]), base => 1);
59        } else {
60          $nmzuri =~ s<^/home/wakaba/public_html/([^.]+)><http://suika.fam.cx/~wakaba/$1>;
61          return ($nmzuri, $nmzuri);
62        }
63      };
64    
65    ## -- WikiPlugin    ## -- WikiPlugin
66    push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {    push @{$WIKI->{event}->{plugin_manager_loaded}}, sub {
# Line 102  push our @Config, sub ($) { Line 113  push our @Config, sub ($) {
113        ## Cache DBs        ## Cache DBs
114        require SuikaWiki::DB::FileSystem::SuikaWikiCache09;        require SuikaWiki::DB::FileSystem::SuikaWikiCache09;
115        my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new        my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new
116              (directory => $wiki->{config}->{path_to}->{db__cache__dir});              (directory => $wiki->{config}->{path_to}->{db__cache__dir},
117                 expires => 86400 * 3, removes => 86400 * 3); # 3 days
118        $wiki->{db}->_set_prop_db (m__search_result =>        $wiki->{db}->_set_prop_db (m__search_result =>
119          {-db => $cachedb, -prop => 'search_result', -db_close => sub {          {-db => $cachedb, -prop => 'search_result', -db_close => sub {
120            my %opt = @_;            my %opt = @_;

Legend:
Removed from v.1.12.4.4  
changed lines
  Added in v.1.12.4.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24