/[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.17 by wakaba, Fri May 7 07:51:28 2004 UTC revision 1.18 by wakaba, Thu Jun 3 06:40:02 2004 UTC
# Line 30  use strict; Line 30  use strict;
30  use Message::Util::QName::General [q<ExpandedURI>], {  use Message::Util::QName::General [q<ExpandedURI>], {
31    'log' => q<http://suika.fam.cx/~wakaba/-temp/2004/05/01/reqlog#>,    'log' => q<http://suika.fam.cx/~wakaba/-temp/2004/05/01/reqlog#>,
32    'media-type' => q<http://suika.fam.cx/~wakaba/-temp/2004/04/24/mt#>,    'media-type' => q<http://suika.fam.cx/~wakaba/-temp/2004/04/24/mt#>,
33      'ss' => q<http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet#>,
34  };  };
35    
36  BEGIN {  BEGIN {
# Line 78  push our @Config, sub ($) { Line 79  push our @Config, sub ($) {
79       [db__lock__log_file      => q"./wikidata/log/lock.log"],       [db__lock__log_file      => q"./wikidata/log/lock.log"],
80       [db__log__dir            => q"./wikidata/log/"],       [db__log__dir            => q"./wikidata/log/"],
81       [db__request_log__dir    => q"./wikidata/rlog/"],       [db__request_log__dir    => q"./wikidata/rlog/"],
82         [db__static__dir         => q"./wikidata/static/"],
83       [db__temp__dir           => q"./wikidata/lock/"],       [db__temp__dir           => q"./wikidata/lock/"],
84       [namazu__index_dir       => q"/var/namazu/index/suikawiki"],       [namazu__index_dir       => q"/var/namazu/index/suikawiki"],
85    ) {    ) {
# Line 166  push our @Config, sub ($) { Line 168  push our @Config, sub ($) {
168          delete $opt{prop_info}->{-db};          delete $opt{prop_info}->{-db};
169        }});        }});
170                
171          ## Static version
172          $wiki->{db}->_set_prop_db (static__css => {-db_open => sub {
173            require SuikaWiki::DB::FileSystem::LeafFileP;
174            SuikaWiki::DB::FileSystem::LeafFileP->new
175              (base_directory => $wiki->{config}->{path_to}->{db__static__dir},
176               directory_suffix => '.ns',
177               file_suffix    => '.css',
178               root_key => $wiki->{config}->{page}->{Default});
179          }, -db_close => sub {
180            my %opt = @_;
181            $opt{prop_info}->{-db}->close;
182            delete $opt{prop_info}->{-db};
183          }});
184          $wiki->{config}->{ExpandedURI q<ss:use-static>} = 1;
185          ## URI maker for LeafFileP generated files
186          $wiki->{config}->{ExpandedURI q<ss:wikiname-to-uri>} = sub {
187            my (undef, %opt) = @_;
188            my $page = join '.ns/',
189                       map {s/([^0-9A-Za-z_-])/sprintf '+%02X', ord $1/ge;$_}
190                       @{$opt{wikiname}};
191            return URI->new ('wikidata/static/' . $page . '.css');
192          };
193          ## Reverse mapping of generate-uri
194          $wiki->{config}->{ExpandedURI q<ss:uri-to-wikiname>} = sub {
195            my (undef, %opt) = @_;
196            $opt{uri} =~ s!^.+/wikidata/static/!!g;
197            $opt{uri} =~ s/\?[^?]*$//g;
198            $opt{uri} =~ s/\.css$//g;
199            return $opt{wiki}->name
200              ([map {s/\+([0-9A-Fa-f_-][0-9A-Fa-f_-])/pack 'CC', hex $1/ge;$_}
201                split m!.ns/!, $opt{uri}]);
202          };
203    
204    
205        ## Cache DBs        ## Cache DBs
206        require SuikaWiki::DB::FileSystem::SuikaWikiCache09;        require SuikaWiki::DB::FileSystem::SuikaWikiCache09;
207        my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new        my $cachedb = SuikaWiki::DB::FileSystem::SuikaWikiCache09->new
# Line 264  push our @Config, sub ($) { Line 300  push our @Config, sub ($) {
300      };      };
301    };    };
302    
303      $WIKI->{config}->{engine_max_access} = 15;
304    
305    ## -- WikiName of special purpose WikiPages    ## -- WikiName of special purpose WikiPages
306    $WIKI->{config}->{page} = {    $WIKI->{config}->{page} = {
307      Default         => $WIKI->name ([qw/HomePage/]),      Default         => $WIKI->name ([qw/HomePage/]),

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24